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

Legacy random question filter conditions break random question on upgrade

XMLWordPrintable

      To reproduce

      1. Create a 4.1 site
      2. Create a course with a quiz
      3. Add a random question to the quiz (I made a new category when I added the question, and there were no questions in the category)
      4. Upgrade to latest master
      5. Browse to the quiz
      6. Press the cog next to the random question created in step 3.
      7. An exception is thrown:

      Exception - qbank_managecategories\category_condition::validate_category_param(): Argument #1 ($categoryandcontext) must be of type string, null given, called in [dirroot]/mod/quiz/classes/question/bank/custom_view.php on line 73
      

      The problem appears to be here where the filtercondition is obtained directly from the DB, rather than being converted on the fly to the new format by convert_legacy_set_reference_filter_condition. Then code a bit further down assumes the filter condition is in the new format.

            cwarwicker CMR
            cameron1729 cameron1729
            Mark Johnson Mark Johnson
            Tim Hunt Tim Hunt
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            18 Vote for this issue
            Watchers:
            29 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 10 minutes
                1d 10m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.