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

Collisions when moving question categories during course category deletion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.5
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      As admin

      1. Create a course in the miscellaneous course cat - C1
      2. Go to the question bank within C1
      3. Go to the categories tab and create a new question category - QC1 - at Misc level by selecting 'top' under 'Category Miscellaneous'.
      4. Create new course cat - CC1 - at the top level (same level as Miscellaneous)
      5. Create a course in that course cat - C2
      6. Go to the question bank within C2
      7. Go to the categories tab and create a new question category - QC2 - at CC1 level by selecting 'top' under 'Category CC1'.
      8. Go to the questions tab and create a true/false question in the QC2 category. Insert a picture in the question text of the question you are creating.
      9. Now, at site admin, delete the course category CC1 and use the default setting to move to miscellaneous category (just click the button)
      10. Now, go into one of the courses (C1 or C2), and view the question bank
      11. Confirm there is no error on the page
      12. Go to the questions tab and set the category filter to list questions of QC2
      13. Confirm that you can see the true/false question you had created earlier.
      14. Preview the question and confirm that the picture you had inserted in the question text is being displayed.
      Show
      As admin Create a course in the miscellaneous course cat - C1 Go to the question bank within C1 Go to the categories tab and create a new question category - QC1 - at Misc level by selecting 'top' under 'Category Miscellaneous'. Create new course cat - CC1 - at the top level (same level as Miscellaneous) Create a course in that course cat - C2 Go to the question bank within C2 Go to the categories tab and create a new question category - QC2 - at CC1 level by selecting 'top' under 'Category CC1'. Go to the questions tab and create a true/false question in the QC2 category. Insert a picture in the question text of the question you are creating. Now, at site admin, delete the course category CC1 and use the default setting to move to miscellaneous category (just click the button) Now, go into one of the courses (C1 or C2), and view the question bank Confirm there is no error on the page Go to the questions tab and set the category filter to list questions of QC2 Confirm that you can see the true/false question you had created earlier. Preview the question and confirm that the picture you had inserted in the question text is being displayed.
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61615-master

      Description

      Noticed this on my integration site, and also occurs on weeklies.

      As admin:

      1. Create a course in the miscellaneous course cat - C1
      2. Go to the question bank within C1
      3. Go to the categories tab and create a new question category - QC1 - at Misc level by selecting 'top' under 'Category Miscellaneous'.
      4. Create new course cat - CC1 - at the top level (same level as Miscellaneous)
      5. Create course in that course cat - C2
      6. Go to the question bank within C2
      7. Go to the categories tab and create a new question category - QC2 - at CC1 level by selecting 'top' under 'Category CC1'.
      8. Now, at site admin, delete the course category CC1 and use default setting to move to miscellaneous category (just click the button)
      9. Now, go into one of the courses (C1 or C2), and view the question bank - notice the errors on the page:

        Error: mdb->get_record() found more than one record!
        line 1583 of /lib/dml/moodle_database.php: call to debugging()
        line 1543 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
        line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
        line 1236 of /lib/questionlib.php: call to moodle_database->get_record()
        line 1290 of /lib/questionlib.php: call to question_get_top_category()
        line 487 of /question/editlib.php: call to question_make_default_categories()
        line 328 of /question/editlib.php: call to question_build_edit_resources()
        line 32 of /question/category.php: call to question_edit_setup()

      Note that applying the patch on MDL-61526 doesn't fix this once the error is seen.

        Attachments

          Activity

            People

            Assignee:
            rezaie9 Shamim Rezaie
            Reporter:
            jaked Jake Dallimore
            Peer reviewer:
            Tim Hunt
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/18

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 37 minutes
                4h 37m