This is my 2nd of 3 updates for trip_search.module. The first is just indenting/style cleanup, which I will commit to CVS as soon as I get access. The attached diffs are against that revision. Below is the list of changes in this patch.. please review/comment and I will commit soon. My 3rd patch will add support for searching comments, including a trip_search.install for module install and upgrade to add the index on comments table.

This patch:
@@163: check for empty taxonomy_terms, in case user clicks radiobutton for taxonomy search, but doesn't select any categories. this avoids php error.
@@200: $form_type is not defined here, change it to 'basic' and move the comment saying "advanced search part" a little further down
@@222: the search has already been done, one line above.. remove repeat
@@1381: $query is not defined here, don't pass it as a parameter
@@1388: $query is passed by reference, don't need to also assign it from return value
@@1408: remove unneeded if; $find is initialized to array(), ok to return that if empty
@@1429: 'nodes' is not a handled $op, just make the default NULL
@@1436: remove unneeded &. also check against $query->search_string to see if MATCHES should be added to query; $query may be nonempty due to other search terms even if requires/excludes are empty.
@@1469: remove unneeded joins
@@1492: refactor to use IN or = instead of a series of ORs. also fix taxonomy search against a category with subcategories (get depth 1 instead of zero)
@@1535: use $max instead of hardcoded 500. also remove unneeded db_num_rows check.. db_fetch_object will return false if there are no rows, and $num isn't used anywhere

CommentFileSizeAuthor
trip_search.module_fixes.txt6.26 KBmindless

Comments

mindless’s picture

Status: Needs review » Fixed

now committed to cvs.

Anonymous’s picture

Status: Fixed » Closed (fixed)