Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
db_fetch_array()
doesn't exist anymore in D7. This may not ever get called but might as well upgrade it.
Comment | File | Size | Author |
---|---|---|---|
#8 | quiz-remove_old_randomisation_structure-283458-8.patch | 9.73 KB | Da_Cloud |
| |||
#3 | 2834587-2.patch | 437 bytes | joelpittet |
| |||
#2 | 2834587-2.patch | 598 bytes | joelpittet |
Comments
Comment #2
joelpittetComment #3
joelpittet--relative
flag on that patchComment #4
joelpittetComment #6
djdevinThanks!
This appears to be called from quiz_questions_form_submit() when making sure there are enough taxonomy terms for the requested number of questions and also in _quiz_get_random_questions() when getting the random questions.
It's a little odd that we haven't seen fatal for this so let me check if this is actually getting called.
Comment #7
Da_Cloud CreditAttribution: Da_Cloud at INDICIA commentedAs far as I can tell that function isn't used anymore. Both the on the manage questions page and when trying to start a quiz you'll get an error message that's triggered by the _quiz_build_categorized_question_list($quiz) function.
A full search on the _quiz_get_random_taxonomy_question_ids() function will result in 2 places where the function is being called.
1) Inside the function _quiz_get_random_questions($quiz)
This one only gets called when the quiz itself has a tid.
2) Inside the function quiz_questions_form_submit($form, &$form_state)
This only gets called when $term_id is not empty. and $term_id is set with the following code
Following the form field random_term_id we'll find the following code
In both cases the code will only be called if $quiz->tid will not result empty. So naturally we'll take a look in the hook_schema what the field does and it seems to be a deprecated piece of code that has long been replaced with a better structure.
Comment #8
Da_Cloud CreditAttribution: Da_Cloud at INDICIA commentedMade a "quick" patch to see which code would be affected should we remove the old structure. Which as far as I can see, seems to be there to support older quizzes after upgrading to a newer version.
Comment #9
djdevinThanks, this looks great. The single term ID is very, very old and just hasn't been removed. In Quiz 4+ you could already have multiple taxonomy terms per quiz so that tid option must be from Quiz 3 or earlier.
I confirmed that there are tests in testCategorizedRandomQuestions for the current behavior.
Comment #10
djdevinI'll leave it RTBC for a bit, but it looks fine to commit.
Comment #11
joelpittetReady to commit yet?
Comment #13
djdevinYes. Fixed!