When Search Ranking is enabled with either TAC (http://drupal.org/project/taxonomy_access) or Workflow (http://drupal.org/project/workflow), all searches come up empty for the anonymous user (anyone without Administer Nodes permission).

To repro:
1) install the above 3 modules and enable Search ranking together with either (Workflow & Workflow access 6.x-1.1) or (Taxonomy Access Control 6.x-1.x-dev).
2) Rebuild the content permissions (www.domain.com/admin/content/node-settings)
3) Then as anon user or user without amin nodes permission try a search (www.domain.com/search/node/Lehrplan

CommentFileSizeAuthor
#3 search-ranking-3129050.patch1.07 KBjcfiala

Comments

johnmunro’s picture

Note that the anonymous user is able to browse the site content but it appears that search ranking cannot.

Either disabling the Search Ranking module or giving the Anon user 'Administer Nodes' permission restores search functionality. Neither of which is desirable, particularly the latter :-))

jcfiala’s picture

Hm. I'm having a similar problem, only I think it's with the content_access module. I'm getting a sql error when trying to search anonymously:

user warning: Unknown column 'na.grant_view' in 'where clause' query: SELECT SUM(i.score * t.count) AS score FROM search_index i INNER JOIN search_total t ON i.word = t.word INNER JOIN node n ON n.nid = i.sid INNER JOIN users u ON n.uid = u.uid WHERE n.status = 1 AND (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'content_access_author') OR (na.gid = 1 AND na.realm = 'content_access_rid'))) AND (i.word = 'johanna') AND i.type = 'node' GROUP BY i.type, i.sid HAVING COUNT(*) >= 1 ORDER BY score DESC LIMIT 0, 1 in /var/www/harvard/harvard_cvs/modules/search/search.module on line 946.

Ah! Patch coming, but I've got to wonder if this has been abandoned.

jcfiala’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

And... patch!

johnmunro’s picture

Not abandoned. I'll see if I can test your patch next week. Thanks for the input John.

jleinenbach’s picture

subscribe

OxideInteractive’s picture

subscribe

mstrelan’s picture

Title: Conflict with TAC and-or Workflow » Conflict with content access related modules

This is also an issue with Domain Access module, however the patch didn't fix the problem. It seems there is a further issue with spacing somewhere, but I disabled the module and don't have time to go back and check it out.

jlea9378’s picture

Installing this patch resolved the problem I was getting where searches by Anonymous users yielded no results.

johnmunro’s picture

Sorry John Fiala, I was not able to test your patch until now, however...

The patch doesn't work for us. Our SQL error is:

user warning: Unknown column 'na.grant_view' in 'where clause' query: SELECT SUM(i.score * t.count) AS score FROM search_index i INNER JOIN search_total t ON i.word = t.word INNER JOIN node n ON n.nid = i.sid LEFT JOIN search_node_links_totals search_node_links_totals ON search_node_links_totals.sid = i.sid LEFT JOIN node_counter nc ON nc.nid = i.sid INNER JOIN users u ON n.uid = u.uid WHERE n.status = 1 AND (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner') OR (na.gid = 1 AND na.realm = 'term_access'))) AND (n.language ='de' OR n.language ='' OR n.language IS NULL) AND (i.word = 'schule') AND i.type = 'node' GROUP BY i.type, i.sid HAVING COUNT(*) >= 1 ORDER BY score DESC LIMIT 0, 1 in /var/www/modules/search/search.module on line 946.

It is the same basic error but seemingly with 'workflow_access' module rather than 'content_access'

Not quite sure how to officially apply patches, but I made the following change to line 181 of 'modules/search_ranking/search_ranking.module'

-        $join1 = implode(' ', $rankings['join']);
+        $join1 .= implode(' ', $rankings['join']);
nuthman’s picture

I'm having the same problem and the patch isn't fixing it for me. After applying the patch, a new error appears:

user warning: Unknown column 'n.nidLEFT' in 'on clause' query: SELECT SUM(i.score * t.count) AS score FROM search_index i INNER JOIN search_total t ON i.word = t.word INNER JOIN node n ON n.nid = i.sid INNER JOIN node_access na ON na.nid = n.nidLEFT JOIN node_comment_statistics c ON c.nid = i.sid INNER JOIN users u ON n.uid = u.uid WHERE n.status = 1 AND (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'content_access_author') OR........