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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 1.9.14
    • 1.9.10
    • Backup

      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.

        1. assignmentbackup.patch
          2 kB
          Chris Follin
        2. assignmentbackup_part2.patch
          0.5 kB
          Chris Follin

            nebgor Aparup Banerjee
            cfollin Chris Follin
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.