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

Restoring process for choice module use incorrect id mapping for choice answer optionid

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.7, 2.2.4, 2.3.1, 2.4
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Choice
    • Labels:
    • Testing Instructions:
      Hide

      Create a choice with some options.
      Log in as a few different students and submit some answers.
      Backup the course including user data
      restore the course into a new course including user data
      login as a teacher and check to make sure the responses look exactly the same in both courses.

      Show
      Create a choice with some options. Log in as a few different students and submit some answers. Backup the course including user data restore the course into a new course including user data login as a teacher and check to make sure the responses look exactly the same in both courses.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:
      master_MDL-34994

      Description

      In function process_choice_answer in file restore_choice_stepslib.php, this line:

      $data->optionid = $this->get_mappingid('choice_option', $oldid);

      Should be changed by:

      $data->optionid = $this->get_mappingid('choice_option', $data->optionid);

      To correctly assign new optionid.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              danmarsden Dan Marsden added a comment -

              thanks for the report!

              Show
              danmarsden Dan Marsden added a comment - thanks for the report!
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

              TIA and ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
              Hide
              damyon Damyon Wiese added a comment -

              Just confirming the bug and that this fix works as advertised.

              Show
              damyon Damyon Wiese added a comment - Just confirming the bug and that this fix works as advertised.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Oh my!

              How did I miss that. It's also wrong @ the dev Docs, where we used choice as example, grrr:

              http://docs.moodle.org/dev/Restore_2.0_for_developers

              Thanks a lot, integrating...

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Oh my! How did I miss that. It's also wrong @ the dev Docs, where we used choice as example, grrr: http://docs.moodle.org/dev/Restore_2.0_for_developers Thanks a lot, integrating...
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Integrated (22, 23 & master), thanks!
              (dev docs also modified)

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks! (dev docs also modified)
              Hide
              ankit_frenz Ankit Agarwal added a comment -

              This works as expected.
              Thanks

              Show
              ankit_frenz Ankit Agarwal added a comment - This works as expected. Thanks
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              I'm so proud...of you, many thanks!

              http://youtu.be/n64CdfDRnZY

              Closing as fixed, ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - I'm so proud...of you, many thanks! http://youtu.be/n64CdfDRnZY Closing as fixed, ciao

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12