Hi there!
I have one Taxonomy term filter exposed using HS. (Taxonomy Term modiffied default view)
If you try to use the options Display the node count or Require associated node my drupal returns

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 ') count_alias' at line 1 query: SELECT COUNT(*) FROM () count_alias in /usr/home/SITE.com/web/sites/all/modules/hierarchical_select/modules/hs_taxonomy_views.module on line 535.

Four times

Any ideas?

Comments

skizzo’s picture

Assigned: charlysole » Unassigned
Category: support » bug

I am seeing the same error (repeated 50 times) when enabling exposed node count on 6.x-3.6. Changing issue category to Bug Report, please change back if already fixed in dev. Unassigning issue, @charlysole: please reassign if you are working on it. Thank you.

Additional configuration details:

Hierarchical Select
- Save only the deepest term
- Allow the user to choose a term from any level
- Display the node count: Enabled
- Require associated node: Disabled
- sizable: Disabled
- Level labels: Disabled
- Dropbox settings: Disabled

View
- Node View
- Style Table
- Filter: Taxonomy: Term Exposed
-- Operator: Is one of
-- Filter identifier: tid_1
-- Optional: Enabled This exposed filter is optional and...
-- Select terms from vocabulary (no additional restriction)

wim leers’s picture

Component: Code - Content Taxonomy Views » Code - Taxonomy Views
wim leers’s picture

Status: Active » Closed (duplicate)
klopsen’s picture

I think it's other sort of thing than in #965482: Missing views_query_substitutions.

I've got similar case like @skizzo and you can see that 'count_query' at line 520 is empty. That's why $count_query is empty and nothing is added at final SELECT query.

The problem is I can't figure out why build_info['count_query'] isn't getting any results... Need to get deeper into view build() function at line 495 in hs_taxonomy_views.module.
Any help?

justinchev’s picture

This ties into issue: http://drupal.org/node/1306002

It occurs when enabling "Display the node count" or "Require associated node".

Think it may only occur when using Views3 (6.x-3.0). I tried it with the latest version of Views2 and it worked.

BTW my error was:
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 ') count_alias' at line 1 query: SELECT COUNT(*) FROM () count_alias in C:\xampp\htdocs\...\sites\all\modules\hierarchical_select\modules\hs_taxonomy_views.module on line 555.

radoya’s picture

Same issue here.

Any solution for Views 3?

kurt.iverson’s picture

I have the same issue with Views 3 as well. Any suggestions?

kurt.iverson’s picture

Status: Closed (duplicate) » Needs review
skizzo’s picture

Reverting issue status, as needs review requires patch
Please refer to Status settings for an issue

wim leers’s picture

Title: hs_taxonomy_views.module on line 535 » SQL error when using Views 3 and the "Display the node count" or "Require associated node" settings
Status: Needs review » Active

1) "needs review" is wrong: there's no patch.
2) updated the issue title
3) this will need some investigative work to get it fixed

wim leers’s picture

wim leers’s picture

Title: SQL error when using Views 3 and the "Display the node count" or "Require associated node" settings » SQL error when using Views 3 exposed filters and the "Display the node count" or "Require associated node" settings
Status: Active » Fixed

Fixed by @peterpoe's patch at #1536648-1: Error when activating "Require associated node" option on views exposed filter.

Commit a77b507 for D7, 6ca6e7a for D6.

kurt.iverson’s picture

this worked for me, thanks!

Status: Fixed » Closed (fixed)

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