apachesolr_search_browse is not calling hook_apachesolr_prepare_query, although it does call hook_apachesolr_modify_query. There should be some refactoring to keep the two in sync without having to change code in two places.

Comments

jpmckinney’s picture

This applies only to 6.x-2.x. The other versions don't have apachesolr_search_browse functionality.

Labeled bug report as it is a bug for apachesolr_search_browse not to run hook_apachesolr_prepare_query.

jpmckinney’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

Fix in HEAD first.

elliotttf’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

Not sure this is exactly the kind of change you were hoping for (since it's not really refactoring, just adding the functionality), but here's a patch that at least gets hook_apachesolr_prepare_query() in apachesolr_search_browse().

pwolanin’s picture

Status: Needs review » Needs work

minor, but

+    $function_name($query, $caller);

versus

   apachesolr_modify_query($query, 'apachesolr');

Looks like the 1st call may be referencing an undefined variable.

elliotttf’s picture

Not sure I'm following you. $caller is one of the function arguments, if there's a chance that could be undefined shouldn't we set a default value of 'apachesolr'? Or is there something else that might be undefined?

pwolanin’s picture

ok, if it's one of the fucntion arguments, then the latter call shoudl not be hard-coded to 'apachesolr'

elliotttf’s picture

Sorry, I was looking at the wrong part of the code (doh). Here's a fixed patch.

elliotttf’s picture

Status: Needs work » Needs review

Updating status since I added a new patch.

pwolanin’s picture

Status: Needs review » Needs work

Please stop using git format-patch

elliotttf’s picture

Sorry, I was following the directions outlined by the git migration team (http://drupal.org/node/1054616). What is the preferred approach? Since your preferred approach is different shouldn't we try to get the git instructions changed?

The documentation does briefly mention git diff but doesn't go into any real detail for using it.

pwolanin’s picture

Wow that doc sucks - that multi-commit formating makes it near impossible to review the patch visually.

pwolanin’s picture

I have edited the doc to indicated usage of git diff
http://drupal.org/node/1054616

pwolanin’s picture

Status: Needs work » Needs review
StatusFileSize
new785 bytes

I rerolled your multi-commit file above to a single diff

elliotttf’s picture

Thanks, the documentation should probably also be updated on the project git instruction pages (i.e. http://drupal.org/node/204268/git-instructions/master ). I'll make sure to roll patches in the way you suggested in the main git instructions document though.

pwolanin’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Patch (to be ported)

committed to master

jpmckinney’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new788 bytes
elliotttf’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

jpmckinney’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.