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

Restore step should generate new unique stamp and version when creating new questions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: Questions, Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      Through the combination of backups and restores of quizzes and courses it is possible to get into a state where get_records_sql_menu throws a warning:

      Did you remember to make the first column something unique in your call to get_records? Duplicate value 'demo.moodle.net+190423142302+7IOe3D demo.moodle.net+190423142302+I9Nqep' found in column 'concat(stamp, ' ', version)'.

      Reproduced on Moodle Sandbox site:

      I am wondering if restore_create_categories_and_questions::process_question() here should be generating a new stamp and version via make_unique_id_code() since at that point we know that the question is a new one?

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ybozhko Yuliya Bozhko
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: