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

restore_dbops; don't use get_backup_ids_records, where a query change to include info will do.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Backup, Performance
    • Labels:
    • Testing Instructions:
      Hide

      1. Backup and restore a course with (blocks, users, quiz, module_availability settings, files, users and renamed roles)
      2. Enable/disable 'zlib' extension (depending on your default setting)
      3. Repeats step one.

      4. Run phpunit with zlib enabled.
      5. Run phpunit with zlib disabled.

      Check both courses are restored correctly and phpunit passes.

      Show
      1. Backup and restore a course with (blocks, users, quiz, module_availability settings, files, users and renamed roles) 2. Enable/disable 'zlib' extension (depending on your default setting) 3. Repeats step one. 4. Run phpunit with zlib enabled. 5. Run phpunit with zlib disabled. Check both courses are restored correctly and phpunit passes.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-40618_restore_get_questions

      Description

      $qs = $DB->get_records_sql("SELECT itemid
                                            FROM {backup_ids_temp}
                                           WHERE backupid = ?
                                             AND itemname = 'question'
                                             AND parentitemid = ?", array($restoreid, $qcatid));
              foreach ($qs as $q) {
                  $temprec = self::get_backup_ids_record($restoreid, 'question', $q->itemid);
                  $results[$q->itemid] = $temprec->info;
              }
              return $results;
      

      Should be rewritten to immediately return the required data from backup_ids_temp rather than re-querying get_backup_ids_record.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr-russ Russell Smith
              Reporter:
              mr-russ Russell Smith
              Peer reviewer:
              Eloy Lafuente (stronk7)
              Integrator:
              Dan Poltawski
              Tester:
              Frédéric Massart
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13