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

Restore backup: add getter method for oldmoduleid

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.8.3, 3.9, 3.10
    • 3.11
    • Backup
    • MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • MDL-69202_311
    • MDL-69202_master
    • Easy
    • Hide
      1. Edit mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php
        1. Go down to after_restore() and add the following line anywhere that is not in an if statement: error_log('oldid: ' . $this->get_old_moduleid());
      2. Save the file.
      3. Go to a course with a lesson or create one.
      4. Back up the lesson
      5. open up the error log
        1. tail -f /var/log/apache2/error.log (or something similar).
      6. Restore the activity.
      7. Once the restore is fully completed look through the error logs for "oldid". Confirm that there is a number next to it.
      Show
      Edit mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php Go down to after_restore() and add the following line anywhere that is not in an if statement: error_log('oldid: ' . $this->get_old_moduleid()); Save the file. Go to a course with a lesson or create one. Back up the lesson open up the error log tail -f /var/log/apache2/error.log (or something similar). Restore the activity. Once the restore is fully completed look through the error logs for "oldid". Confirm that there is a number next to it.

    Description

      When using a restore class method for a plugin (<plugintype>\<pluginname>\backup\moodle2\restore_<plugintype>_<pluginname>_plugin.class.php), the task contains the oldmoduleid.

      The information can be seen by $this->task->get_info();

      But you can not access the oldmoduleid direct, as it's protected.

      Therefore we should add here the missing getter method to access this variable if needed.

      Attachments

        Activity

          People

            pead Adrian Perez
            pead Adrian Perez
            Peter Dias Peter Dias
            Adrian Greeve Adrian Greeve
            Sujith Haridasan Sujith Haridasan
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              17/May/21

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 15 minutes
                2h 15m