Views page is broken after the following code update

$query->addTag('term_access');
Line: 207 (sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc)

Removing the $query->addTag fixed the broken view, I have upgraded to 7.x-3.16 and that didn't fix the bug.

Following is dblog for the error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'tid' in where clause is ambiguous: SELECT td.tid AS tid, REPLACE(td.name, ' ', '-') AS name FROM {taxonomy_term_data} td LEFT OUTER JOIN {taxonomy_vocabulary} tv ON td.vid = tv.vid LEFT OUTER JOIN {taxonomy_term_data} tac_td ON td.tid = tac_td.tid WHERE (tid IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3)) AND (tv.machine_name IN (:db_condition_placeholder_4)) AND( (td.tid IN (:db_condition_placeholder_5)) OR (tac_td.vid NOT IN (:db_condition_placeholder_6)) ); Array ( [:db_condition_placeholder_0] => 52 [:db_condition_placeholder_1] => 54 [:db_condition_placeholder_2] => 55 [:db_condition_placeholder_3] => 58 [:db_condition_placeholder_4] => profile_type [:db_condition_placeholder_5] => 0 [:db_condition_placeholder_6] => 1 ) in views_plugin_argument_validate_taxonomy_term->process_summary_arguments() (line 221 of /sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jozzy_a created an issue. See original summary.

jozzy_a’s picture

Issue summary: View changes
DamienMcKenna’s picture

Status: Active » Postponed (maintainer needs more info)

I'm sorry you've run into that problem. What module(s) are implementing that query tag? It's likely another module improperly modifying the query, but we'd like to know more. Thanks.

jozzy_a’s picture

After much debugging, I think I have found the module which is improperly modifying the query.
The problem module is Tac Lite (http://cgit.drupalcode.org/tac_lite/tree/tac_lite.module#n729), commenting out the left joins fixes the broken views.

chellman’s picture

Version: 7.x-3.15 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Needs review
FileSize
767 bytes

I had this same issue related to forum_access and/or ACL modules, where tables that include a "tid" field are causing ambiguity. It took me a while to track it down because it only happened when I was logged out. Anyway, I think I've found a solution for it, patch attached.

chellman’s picture

Title: View broken from security update made on 7.x-3.15 for anonymous users » views_plugin_argument_validate_taxonomy_term has ambiguous column tid
Component: Miscellaneous » Code

Updated metadata

mstrelan’s picture

I found the same issue with termstatus module and came to the same solution as #5. I believe it's RTBC but not confident to update the status.

chellman’s picture

Got bitten by this again after the latest Views update. Patch from #5 still applies.

BTMash’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

DamienMcKenna’s picture

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks.

Status: Fixed » Closed (fixed)

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