Closed (fixed)
Project:
XML sitemap
Version:
7.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2010 at 21:28 UTC
Updated:
23 Feb 2011 at 22:30 UTC
If you have the xmlsitemap_taxonomy module enabled and visit admin/config/search/xmlsitemap/settings you get this:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause: SELECT v.machine_name AS vocabulary_machine_name, COUNT(:id) AS count_expression FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (tid > :db_condition_placeholder_0) AND (machine_name = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => tags [:id] => tid ) in xmlsitemap_get_link_type_indexed_status() (line 992 of /web/drupal/sites/all/modules/xmlsitemap/xmlsitemap.module).
This is due to the fact that the module is trying to alter a query that already has an explicit COUNT() expression in it.
Resolving the existing @todo for this query (and converting it to a normal count query) fixes the bug and seems to work correctly as well. This is a simple patch, but the fact that it had a @todo in the first place makes me wonder if I'm missing something :)
| Comment | File | Size | Author |
|---|---|---|---|
| xmlsitemap-fix-count-query.patch | 1.5 KB | David_Rothstein |
Comments
Comment #2
David_Rothstein commentedI think that test failure must be a preexisting one...
Comment #3
dave reidWith the patch applied I get the following fatal error on admin/config/search/xmlsitemap/settings:
"PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {menu_links} base WHERE (mlid > :db_condition_placeholder_0) AND (menu_name = :db_condition_placeholder_1) ) subquery; Array ( [:db_condition_placeholder_0] => 0 ) in xmlsitemap_get_link_type_indexed_status() (line 992 of /home/davereid/Dropbox/Projects/drupal7dev/sites/all/modules/xmlsitemap/xmlsitemap.module)."
Comment #4
David_Rothstein commentedHm, very strange. I see the same query running but don't get the error. In my case, there is always a second argument, so ':db_condition_placeholder_1' always gets set to the name of a particular menu.
This part of the query gets added in xmlsitemap_query_xmlsitemap_link_bundle_access_alter(). Maybe if you get a chance you can check to see what data is being used in that function when it winds up adding the broken condition to the query?
Comment #5
dave reidThis should be fixed now. I'm using EntityFieldQuery to query those tables.