Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#5 | ambiguous-tid-2871727-5.patch | 767 bytes | chellman |
|
Comments
Comment #2
jozzy_a CreditAttribution: jozzy_a at Torchbox commentedComment #3
DamienMcKennaI'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.
Comment #4
jozzy_a CreditAttribution: jozzy_a at Torchbox commentedAfter 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.
Comment #5
chellman CreditAttribution: chellman as a volunteer commentedI 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.
Comment #6
chellman CreditAttribution: chellman as a volunteer commentedUpdated metadata
Comment #7
mstrelan CreditAttribution: mstrelan commentedI 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.
Comment #8
chellman CreditAttribution: chellman commentedGot bitten by this again after the latest Views update. Patch from #5 still applies.
Comment #9
BTMash CreditAttribution: BTMash as a volunteer commentedLooks good to me.
Comment #10
DamienMcKennaComment #11
DamienMcKennaCommitted. Thanks.