Backup problem after clean install of 1.6.1+

Vast: Please Disregard this Question - Problem Solved

by Ari Tahvanainen -
Number of replies: 0

Hi,

Error comes if there isn't any array in the foreach loop.

If course don't have modules, error comes.

There are three other foreach loops, which produce same error. And same situation on restore.

Here is fix. In backup/backuplib.php is function backup_fetch_prefs_from_request(&$preferences,&$count,$course). At the end of it, about on line 2024, should be

          //If modules not exist, foreach loops falls without array
          if(!$preferences->mods){
               $preferences->mods=array();
           }

I haven't test it in Moodle 1.7. Hopefully it's repaired there.

- ari -