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

Adding subsections beyond the maximum number of sections breaks course backup and restore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 4.5
    • Backup, Course, Subsection
    • None
    • MOODLE_405_STABLE
    • Hide
      1. Set the 'maxsections' to 14.
      2. Enable 'mod_subsection'.
      3. Create a 'Custom sections' course with 12 sections.
      4. Turn editing on.
      5. In the last section (12), add a sub-section.
      6. In the section before that (11), add a sub-section.
      7. Observe that "You have reached the maximum number of sections allowed for a course." is now shown at the bottom of the sections.
      8. In the section before that (10), add a sub-section. This is still possible.
      9. In the section before that (9), add a sub-section. This is still possible.
      10. Backup the course, 'Course reuse' without users.
      11. Restore the course and observe the course never restores.

      Note: If xDebug is configured with developer level debugging, cron (in my case via the browser), will display:

      {{Adhoc task failed: core\task\asynchronous_restore_task,Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '256' frames
      Backtrace:

      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to backup_setting->calculate_checksum()
      • line 241 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum()
      • line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum()
      • line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum()
      • line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum()
      • line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive()
        ......
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum()
      • line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum()
      • line 169 of \backup\util\plan\base_plan.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_plan->calculate_checksum()
      • line 277 of \backup\controller\restore_controller.class.php: call to backup_general_helper::array_checksum_recursive()
      • line 494 of \backup\controller\restore_controller.class.php: call to restore_controller->calculate_checksum()
      • line 241 of \backup\controller\restore_controller.class.php: call to restore_controller->save_controller()
      • line 97 of \lib\classes\task\asynchronous_restore_task.php: call to restore_controller->set_status()
      • line 519 of \lib\classes\cron.php: call to core\task\asynchronous_restore_task->execute()
      • line 302 of \lib\classes\cron.php: call to core\cron::run_inner_adhoc_task()
      • line 128 of \lib\classes\cron.php: call to core\cron::run_adhoc_tasks()
      • line 80 of \admin\cron.php: call to core\cron::run_main_process()}}

      For the adhoc restore task.

      Show
      Set the 'maxsections' to 14. Enable 'mod_subsection'. Create a 'Custom sections' course with 12 sections. Turn editing on. In the last section (12), add a sub-section. In the section before that (11), add a sub-section. Observe that "You have reached the maximum number of sections allowed for a course." is now shown at the bottom of the sections. In the section before that (10), add a sub-section. This is still possible. In the section before that (9), add a sub-section. This is still possible. Backup the course, 'Course reuse' without users. Restore the course and observe the course never restores. Note: If xDebug is configured with developer level debugging, cron (in my case via the browser), will display: {{Adhoc task failed: core\task\asynchronous_restore_task,Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '256' frames Backtrace: line 49 of \backup\util\helper\backup_general_helper.class.php: call to backup_setting->calculate_checksum() line 241 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive() line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum() line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive() line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive() line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum() line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive() line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive() line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum() line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive() line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive() line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum() line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive() line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive() ...... line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum() line 51 of \backup\util\helper\backup_general_helper.class.php: call to backup_general_helper::array_checksum_recursive() line 242 of \backup\util\plan\base_task.class.php: call to backup_general_helper::array_checksum_recursive() line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_task->calculate_checksum() line 169 of \backup\util\plan\base_plan.class.php: call to backup_general_helper::array_checksum_recursive() line 49 of \backup\util\helper\backup_general_helper.class.php: call to base_plan->calculate_checksum() line 277 of \backup\controller\restore_controller.class.php: call to backup_general_helper::array_checksum_recursive() line 494 of \backup\controller\restore_controller.class.php: call to restore_controller->calculate_checksum() line 241 of \backup\controller\restore_controller.class.php: call to restore_controller->save_controller() line 97 of \lib\classes\task\asynchronous_restore_task.php: call to restore_controller->set_status() line 519 of \lib\classes\cron.php: call to core\task\asynchronous_restore_task->execute() line 302 of \lib\classes\cron.php: call to core\cron::run_inner_adhoc_task() line 128 of \lib\classes\cron.php: call to core\cron::run_adhoc_tasks() line 80 of \admin\cron.php: call to core\cron::run_main_process()}} For the adhoc restore task.

      It is possible to have a course that has more sections and sub-sections that exceeds 'maxsections'. This then causes issues with the backup file which upon attempting to restore, fails.

            Unassigned Unassigned
            gb2048 Gareth J Barnard
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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