I just recently ran into a really weird ...well, bug I guess.
When doing a search on my site, I'm running into some weirdness whenever a quiz is returned in the search results. The following seems to be occurring:
1. The search page title changes to the title of the quiz. It's as if $title was overridden by the quiz, and instead of saying "Search" in the head tag and at the top of the page, I'm getting the title of my quiz instead. This occurs even after disabling the module.
2. When I created a test quiz that didn't have any questions and did a search, my search page displayed the "No questions were found. Please assign questions before trying to take this Quiz." error message at the top.
3. When using Drupal for Firebug, I can see that the Quiz is being loaded as a search result, plus the first question of that quiz is also being loaded, but just a regular load, not as a search result.
4. When doing a search as an anonymous user that returns a multi-choice question in the results, I get an access denied page instead of the results page. If I give my anonymous user "create multichoice", then the access denied message goes away. (I'm still having problems just having search results displayed for anonymous users, but that's a whole other problem) (Incidentally, is there any way to prevent multi-choice questions from being indexed and returned in search results?)
Any ideas as to what's going on here? I used CCK to add a few new fields to my quiz content type (some text fields, image fields, etc.) Might that be mucking things up?
Using:
Drupal 6.10
Quiz 6.x-2.1
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | Screenshot.png | 67.35 KB | sivaji_ganesh_jojodae |
Comments
Comment #1
mbutcher commentedWould you mind testing in Quiz 3?
I suspect that something funny is happening in the Node API. I changed the way quizzes were loaded between 2.1 and 3 (to support CCK, actually), so I am curious whether this bug exists in the new code.
Comment #2
Stephen Scholtz commentedSure, I'll have a look at it in a few days. I'm under the gun with a deadline at the moment, but I have a local copy of the site in question set up on which I could put Quiz 3 and see how it goes.
Comment #3
mbutcher commentedTrying to clean up the issue queue for an Alpha release, so I'm setting the status to "Needs more info"
Comment #4
mbutcher commentedmarked as Quiz 3
Comment #5
Stephen Scholtz commentedHi there,
Sorry, still haven't had a chance to install Quiz 3 and see what happens with this bug, in the middle of crunch time right now. Hopefully next week. :P
Comment #6
Stephen Scholtz commentedHoping to test out Quiz 3 tomorrow, I need to mirror my production site and then install it. Will see what happens with Quiz 3 and search results.
Comment #7
Stephen Scholtz commentedFinally got this set up on my local machine and test with Quiz 3. Unfortunately, the bug still exists.
The only change I see is that now I get a couple of extra status messages showing up:
Sometimes those messages will appear multiple times on the search result page.
One thing I noticed, if it helps, is that this Title overwrite only seems to happen when the search results contain a quiz. If the search results contain a Multi-choice question, it seems to be fine. (Digression for beginner Drupal users: will be looking into something like Search Config to remove the Multi-choice content type from the Search indexing; haven't tested it yet, but might work)
Using:
Drupal 6.10
MySQL 5.0.67
PHP 5.2.9
Quiz 3.0-Beta 1
Will upgrade to Drupal 6.12 on my local environment tomorrow and see if that does anything.
Comment #8
mbutcher commentedAh... I understand. When search results return quiz items, too much is getting loaded. I guess I'd better find out what sort of node_view() a search call does and make sure we handle that.
Comment #9
mbutcher commentedGuess this should be marked active again.
Comment #10
rblomme commentedMaybe drupal_set_title() should not be executed in quiz_take_quiz() (called by quiz_view()) while displaying search results... ?
Comment #11
sivaji_ganesh_jojodae commentedrblomme yes, you are correct.
Also the Search result page looks very weird for me (please check the snapshot)
Comment #12
rblomme commentedUse the $page parameter from the quiz_view hook:
Comment #13
sivaji_ganesh_jojodae commented@rblomme Thanks for the $page parameter trick. The following changes has fixed this issue.
1. in multichoice.module
2 in quiz.module