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 :)

Comments

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-fix-count-query.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Needs review

I think that test failure must be a preexisting one...

dave reid’s picture

With 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)."

David_Rothstein’s picture

Hm, 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?

dave reid’s picture

Status: Needs review » Fixed

This should be fixed now. I'm using EntityFieldQuery to query those tables.

Status: Fixed » Closed (fixed)

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