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.
To my eyes, it seems that the $type parameter is completely ignored in the do_search function, thus rendering search functionality severely crippled, especially when dealing with modules that implement their own search. This patch adds the "where type = '%s'", $type
bit to the SQL for gathering search results.
Comment | File | Size | Author |
---|---|---|---|
#1 | search_do_search_0.patch | 933 bytes | robertDouglass |
search_do_search.patch | 1.33 KB | robertDouglass | |
Comments
Comment #1
robertDouglass CreditAttribution: robertDouglass commentedoops... patch without Eclipse project info =)
Comment #2
oadaeh CreditAttribution: oadaeh commentedForgive my ignorance with the underpinnings of Drupal, but is there ever a time when $type might be null or ==""? If so, then there should probably be a check for that before inserting it into the SQL statement.
Comment #3
robertDouglass CreditAttribution: robertDouglass commentedTheoretically it isn't possible, since $type is a required parameter of the function. That said, if some code has been calling do_search with $type = '', nothing bad would have happened, and that code would break. This is to be desired, however, since the calling code doesn't conform to the published API. I don't believe this happens anywhere in core.
Comment #4
Steven CreditAttribution: Steven commentedGood catch... I noticed this when doing 4.7 search, but never got around to backporting it to 4.6. Note that the doxygen also needed to be updated.
Committed to 4.6.
Comment #5
(not verified) CreditAttribution: commented