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

Infinite recursion calculating backup controller checksum

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • 4.0.1
    • Backup
    • None
    • MOODLE_400_STABLE

    Description

      Place the two attached scripts in Moodle's root. From the CLI run: php createbackup.php then use the ID it returns to run: php failbackup.php [ID HERE]

      You'll see that the controller is loaded, but the call to set its status as failed never completes.

      The following code however, is able to mark a backup as failed:

      $bc = new backup_controller(backup::TYPE_1COURSE, 1, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_COPY, 2, backup::RELEASESESSION_YES);
      $bc->set_status(backup::STATUS_FINISHED_ERR);
      

      i.e., if the controller is marked as failed in the same session it's created in, everything is fine. But when it's loaded from the DB in a different session, it can't be marked as failed. It appears that there's some infinite recursion problem when it tries to calculate the checksum.

      Attachments

        1. createbackup.php
          0.3 kB
        2. failbackup.php
          0.3 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cameron1729 cameron1729
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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