I have view that's failing to display any nodes. I've tracked the issue down to tac_lite_query_term_access_alter().
The code in there is identifies 'node' as the $primary table then attempts to join taxonomy_term_data.tid against node.tid causing an sql error.
The nodes I am trying to display are of Content Type 'pressrelease' which contains a Term reference field 'taxonomy_vocabulary_8'. The term is represented in the database by the table 'field_data_taxonomy_vocabulary_8' which has a field 'taxonomy_vocabulary_8_tid'.
Dump of $t ($query->getTables()) is :
Array
(
[node] => Array
(
[join type] =>
[table] => node
[alias] => node
[condition] =>
[arguments] => Array
(
)
)
[field_data_taxonomy_vocabulary_8] => Array
(
[join type] => LEFT
[table] => field_data_taxonomy_vocabulary_8
[alias] => field_data_taxonomy_vocabulary_8
[condition] => node.nid = field_data_taxonomy_vocabulary_8.entity_id AND (field_data_taxonomy_vocabulary_8.entity_type = :views_join_condition_0 AND field_data_taxonomy_vocabulary_8.deleted = :views_join_condition_1)
[arguments] => Array
(
[:views_join_condition_0] => node
[:views_join_condition_1] => 0
)
)
[taxonomy_term_data_field_data_taxonomy_vocabulary_8] => Array
(
[join type] => LEFT
[table] => taxonomy_term_data
[alias] => taxonomy_term_data_field_data_taxonomy_vocabulary_8
[condition] => field_data_taxonomy_vocabulary_8.taxonomy_vocabulary_8_tid = taxonomy_term_data_field_data_taxonomy_vocabulary_8.tid
[arguments] => Array
(
)
)
[na] => Array
(
[join type] => INNER
[table] => node_access
[alias] => na
[condition] => na.nid = node.nid
[arguments] => Array
(
)
)
)
Appears to be a bug in how it identifies the tid, but I'm unsure how to fix. Please let me know if I can provide any more information.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | patch-tac-lite-visibility-join.patch | 22.86 KB | cocorodeo |
Comments
Comment #1
hanoiiThis also happened to me, there's something wrong in that logic.
In my case, I have a node that has two taxonomy fields. Then I have a view that lists those nodes, then adds a relationship to its taxonomy term data and each taxonomy term relationhship is again related to one content of another type that also is tagged by that taxonomy. This works with admin but tac_lite messes up the query with this same error (node.tid which doesn't exists).
In my case, I just disabled views node access tags to workaround this.
Comment #2
Dave Cohen commentedThat hook is passed a barely-documented thing called a QueryAlterableInterface.
It tries to learn the name of the query's primary table, but it has to guess. See the inline comment that starts "HELP..."
It sounds very complicated to try to reproduce your cases. Can you add this debug code to tac_lite.module and let me know what you see?
Comment #3
colinodell commentedI'm also seeing this exact same behavior and error.
Our workaround was to add this line right before the
$query->leftJoin():Why? Because the node table doesn't have a
tidcolumn, so we know the query will always fail in those cases. The other nice thing about this workaround is that it doesn't impact valid usages where this function works, nor does it require disabling any other permission checks.Comment #4
cocorodeo commentedHi guys,
I posted comments on another issue #2850750
but I think it's more related to te current issue.
Here is a workaround I've done to achieve fixing sql errors on non-existing table for the visibility
LEFT OUTER JOINI'm joining a patch I'v done ... Comments and corrections are welcome.