Closed (duplicate)
Project:
Hierarchical Select
Version:
6.x-3.3
Component:
Code - Taxonomy Views
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 May 2010 at 23:04 UTC
Updated:
19 Sep 2010 at 12:08 UTC
Hello,
I just tried the Hierarchical Select module to enhance my views 2 taxonomy filters, and got the following error when I try to enable "Display the node count" or "Require associated node".
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '***CURRENT_USER***) LEFT JOIN flag_content flag_content_node_1 ON node.nid = fl' at line 3 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS nid FROM node node LEFT JOIN flag_content flag_content_node ON node.nid = flag_content_node.content_id AND (flag_content_node.fid = 1 AND flag_content_node.uid = ***CURRENT_USER***) LEFT JOIN flag_content flag_content_node_1 ON node.nid = flag_content_node_1.content_id AND (flag_content_node_1.fid = 3 AND flag_content_node_1.uid = ***CURRENT_USER***) LEFT JOIN flag_content flag_content_node_2 ON node.nid = flag_content_node_2.content_id AND (flag_content_node_2.fid = 2 AND flag_content_node_2.uid = ***CURRENT_USER***) INNER JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN content_field_image node_data_field_image ON node.vid = node_data_field_image.vid LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = ***CURRENT_USER*** INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN flag_content flag_content ON node.nid = flag_content.content_id AND (flag_content.fid = 2 AND flag_content.uid = ***CURRENT_USER***) LEFT JOIN flag_content flag_content2 ON node.nid = flag_content2.content_id AND (flag_content2.fid = 3 AND flag_content2.uid = ***CURRENT_USER***) LEFT JOIN flag_content flag_content3 ON node.nid = flag_content3.content_id AND (flag_content3.fid = 1 AND flag_content3.uid = ***CURRENT_USER***) LEFT JOIN content_type_video node_data_field_date ON node.vid = node_data_field_date.vid WHERE term_node.tid = 99 ) count_alias in /dev/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 529.
There are actually lots of errors, but they seem to be similar in nature.
The view works totally fine, though it is quite complex with various filters and relationships.
Best,
Andrey.
Comments
Comment #1
mr.andrey commented(settings a more accurate title)
So troubleshooting... the error seems to come from this line in hs_taxonomy_views.module:
For some reason $count_query's ***CURRENT_USER*** doesn't get replaced with the user id.
Adding this right before makes the errors go away, and everything function as intended:
The above is not really a solution, it just shows the cause of the problem.
Andrey.
Comment #2
pochota commentedThis bug is still active. Please, fix it for a new release.
Thanks.
Comment #3
mr.andrey commentedI ended up writing my own solution to display only the terms that are used.
Comment #4
wim leersSee #564052: HS + Views: exposed filters in block + hs_taxonomy_views results in fatal error on clone_view() when node counting enabled.