Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27174

Automated Backups Fail When Assignment Course Module Has Instance of Zero (0)


    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.10
    • Fix Version/s: 1.9.14
    • Component/s: Backup
    • Labels:


      We have multiple client sites with automated backups that do not complete. Error messages point to the assignment module trying to require a file that doesn't exist.

      PHP Warning: require_once(<moodle_root>/mod/assignment/type//assignment.class.php): failed to open stream: No such file or directory in <moodle_root>/mod/assignment/backuplib.php on line 79
      PHP Fatal error: require_once(): Failed opening required '<moodle_root>/mod/assignment/type//assignment.class.php' (include_path='<moodle_root>/lib/pear:.:/usr/share/php:/usr/share/pear') in <moodle_root>/mod/assignment/backuplib.php on line 79

      The middle of the require_once where it has a double slash should have been populated with the assignment type. It's not populated because the course_module record for the assignment has an instance of 0 so Moodle doesn't know what kind of assignment it is. The instance=0 records show up after a course is restored from backup, although not every restore has this issue and it is not limited to backups from different servers.

      We created a patch that allows the assignment backup to skip assignments that have an instance of 0 and removes such records when restoring.

        Gliffy Diagrams


            Issue Links



                • Votes:
                  0 Vote for this issue
                  4 Start watching this issue


                  • Created:
                    Fix Release Date: