Closed (won't fix)
Project:
Apache Solr Search
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2011 at 22:53 UTC
Updated:
28 Dec 2011 at 10:38 UTC
Jump to comment: Most recent file
Comments
Comment #1
elliotttf commentedHere's a first cut of a patch to do this.
Comment #2
elliotttf commentedWow, added some stuff I didn't mean to there. Here's a cleaner patch, sorry about that...
Comment #3
elliotttf commentedI have re-rolled the patch for D7 in regards to the updated roadmap.
Comment #4
pwolanin commentedInteresting idea.
At least a minor problem, I think, with this line:
The path may not be the name of the module, and if you are passing in a query string, there is an array form of the arguments to drupal_goto()
Comment #5
elliotttf commentedI've rolled another patch that will account for search modules using alternate paths (I wasn't aware of this change in the API, learn something new every day :)).
I don't think arguments are included in the $querystring variable. If you look where apachesolr_failure() is called you can see only the keys variable is being passed, not the full query array:
Comment #6
pwolanin commentedThis needs to be fixed:
At the least it needs to use drupal_goto() correctly. It should ideally pass the full query string in also.
Comment #7
pwolanin commented2 other fixes:
should just be:
and:
Then you can just look in the array by key, rather than using a foreach here:
Comment #8
elliotttf commentedRerolled with changes as requested with the exception of drupal_goto(). I'm not actually sure what the problem you're referring to is. The code is essentially the same as what was already in the module:
Comment #9
pwolanin commentedYes, I'm saying that code even though already in the module needs to be improved and should also pull in other query arguments and pass an array to drupal_goto()
Other parts look improved, though the logic at the end isn't quite right.
Should be like:
Since a module can be enabled generally but DISABLED for search thanks to my changes in the 7.x core search API.
see: http://api.drupal.org/api/drupal/modules--search--search.module/function...
Comment #10
elliotttf commentedShould we create a new issue for the drupal_goto() change? I'm happy to implement it here but it's kind of out of scope for what this issue was originally trying to provide.
Comment #11
pwolanin commentedIn general it would be nice to get it all in one, but since the drupal_goto() part might be relevant to Drupal 6 versions, feel free to create a separate follow-up issue if you prefer.
Comment #12
elliotttf commentedFor cross reference, I've created a new issue for the drupal_goto() array here: http://drupal.org/node/1105584
Here's a re-rolled patch with the above changes.
Comment #13
pwolanin commented'show_error' and 'show_no_results' could, in theory, be valid module names.
Perhaps we should change them to use dash, space, or some other separator?
Comment #14
elliotttf commentedGood point! Here's another patch with namespaced variables for show_error and show_no_results.
Comment #15
pwolanin commentedok, looking better - we should probably also add a little update function for good measure.
Comment #16
elliotttf commentedPatch with update hook to reset variables based on new naming conventions.
Comment #17
pwolanin commentedok, looking close, but in the update function, it would be better to have e.g. NULL as the default for the variable_get() call and not set anything if it wasn't set already.
Comment #18
elliotttf commentedboom
Comment #19
pwolanin commentedTesting it out locally - one problem is that the 'title' returned by hook_search_info() is the title of the tab, not the name of the module, e.g. as presented on http://api.drupal.org/api/drupal/modules--search--search.admin.inc/funct...
Comment #20
pwolanin commentedcommitted this revised patch.
Comment #21
elliotttf commentedOriginally I needed this functionality for a client that's on D6, so marking as patch to be ported, will upload a port shortly.
Comment #22
elliotttf commentedI'm not sure the way I'm showing the module name is optimal but it seems to be the closest thing to system_get_info() in D6 that we can get without having to parse all the info files from all the modules (when really we're only interested in the search modules).
Comment #23
pifantastic commentedTested elliotttf's patch and everything works correctly:
Comment #24
jpmckinney commentedThis will send users to 'search/apachesolr:show_error/...'. Not sure how this got RTBC.
Comment #25
elliotttf commentedActually, that case is caught above:
The only time 'default' is reached is if a search module is selected as the failover, not one of the two predefined apachesolr cases. Additionally, the default case checks to make sure that the fail rule is a valid module before firing the drupal_goto().
Comment #26
jpmckinney commentedMy bad. Looks fine.
Comment #27
nick_vhThe 6.x-2.x version has been deprecated. Moving this to 6.x-1.x-dev
Comment #29
pwolanin commentedAny features against 7.x first.
Comment #30
nick_vhThis was added to the D7 version. Closing this one since the backport will include this functionality