When I login as a user with no permissions to "search content", and take a look at the taxonomy page, I see a search form and the filter-blocks on the right.

"Make Apache Solr Search the default" is enabled.
"Use Apache Solr for taxonomy links" is enabled.

Possibly test for the "search content" permission before displaying the search form and the blocks?

Comments

jpmckinney’s picture

Title: Solr taxonomy page displays search form and blocks when the user has no access to the seach » [taxonomy] Solr taxonomy page displays search form and blocks when the user has no access to the seach
Issue tags: +taxonomy hijack
jpmckinney’s picture

Title: [taxonomy] Solr taxonomy page displays search form and blocks when the user has no access to the seach » Solr taxonomy page displays search form and blocks when the user has no access to the seach
jpmckinney’s picture

StatusFileSize
new4.71 KB

Wow, was that function broken.

* $title undefined
* allowed access to $tids that the user may not have access to
* calls drupal_add_feed twice if it calls back to taxonomy_term_page
* uses search_help('search#noresults', drupal_help_arg()) instead of variable_get('apachesolr_search_noresults', apachesolr_search_noresults())
* and, as noted here, doesn't check user_access('search content')

Synced this function better with taxonomy_term_page

jpmckinney’s picture

Status: Active » Needs review

Same patch applies to 6.x-2.x

jpmckinney’s picture

StatusFileSize
new3.05 KB

Patch for 7. Note that D7 doesn't fail back to taxonomy_term_page. It also doesn't have the check:

in_array('im_vid_' . $term->vid, apachesolr_get_enabled_facets('apachesolr_search'))
jpmckinney’s picture

StatusFileSize
new5.09 KB

Updated D6 to set breadcrumb as in taxonomy_term_page.

jpmckinney’s picture

StatusFileSize
new5.37 KB

Merging #716104: Taxonomy hijack should fall back if SOLR is not present into this. Fixed watchdog error to be more descriptive, too.

jpmckinney’s picture

elliotttf’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.41 KB

One thing I did find, if using PHP 5.3 you'll get a strict warning on the taxonomy page. This problem actually exists in the taxonomy module too, but can be fixed by initializing the $current object before using it:

<?php
// ...
// Build breadcrumb based on first hierarchy of first term:
$current = new stdClass();
$current->tid = $tids[0];
// ...
?>

I've rerolled the patch with that one change but otherwise the patch looks good to me.

pwolanin’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

committed to 6.x-1.x and 6.x-2.x

not sure if some of the changes need to made also for 7.x.

jpmckinney’s picture

Status: Patch (to be ported) » Needs review

See #5 :)

pwolanin’s picture

Status: Needs review » Fixed
StatusFileSize
new3.08 KB

Committing this for 7 - a couple minor tweaks.

Status: Fixed » Closed (fixed)
Issue tags: -taxonomy hijack

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