Dear maintainer:
I get this error, when I try to see the forum (http://wiki9999.org/en/forum):
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous: SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => en [:db_condition_placeholder_2] => und ) in forum_forum_load() (line 779 of /usr/www/users/wikibi/drupal7-wiki9999/modules/forum/forum.module).
You can see the error here => http://wiki9999.org/en/forum (user: wiki9999; login: home9999) (Not yet productive)
That error happens independently if the "multilingual forum" module is activated or not activated.
The tables "forum" and "forum_index" are empty.
Please do not hesitate, if you need further information.
Best regards,
Schnittmenge
Comment | File | Size | Author |
---|---|---|---|
#17 | 1431452-ambiguos-status.patch | 494 bytes | webflo |
#15 | 1431452-ambiguos-status-D7.patch | 494 bytes | webflo |
#13 | 1431452-ambiguos-status-D7.patch | 494 bytes | webflo |
#3 | 1431452-ambiguos-status.patch | 514 bytes | larowlan |
Comments
Comment #1
fergusong CreditAttribution: fergusong commentedFor what it's worth, this seems similar to
http://drupal.org/node/1430386
Comment #2
larowlanComment #3
larowlanComment #4
Schnittmenge CreditAttribution: Schnittmenge commentedThank you for the patch.
Now, I get other errors =>http://local.wiki9999.org:8888/de/forum =>
Warning: Invalid argument supplied for foreach() in forum_menu_local_tasks_alter() (Zeile 175 von ..../modules/forum/forum.module).
http://local.wiki9999.org:8888/de/forum#overlay=de/admin/structure/forum =>
Notice: Trying to get property of non-object in taxonomy_term_save() (Zeile 595 von /Users/daniel/svns-macbook/Drupal-7-wiki9999/modules/taxonomy/taxonomy.module).
EntityMalformedException: Fehlende Paketeigenschaft auf einem Element des Types taxonomy_term. in entity_extract_ids() (Zeile 7501 von /Users/daniel/svns-macbook/Drupal-7-wiki9999/includes/common.inc).
What should I do? (Drupal 7.12)
Comment #5
larowlanBugs get fixed in 8 first then backported.
If the patch works for you, please mark the ticket as 'reviewed and tested by the community'.
Then after committed, we'll get the D7 backport.
Regarding invalid argument supplied for foreach() in forum_menu_local_tasks_alter() - there is an existing ticket for that - see #1157142: Watchdog: Undefined index: node in forum_menu_local_tasks_alter() (line 175 of ../forum/forum.module.
Comment #6
Zarevac CreditAttribution: Zarevac commentedAfter applying patch #3 I get this:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node.tid' in 'on clause': SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (n.status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => en [:db_condition_placeholder_2] => und ) in forum_forum_load() (line 780 of /modules/forum/forum.module).
Comment #7
Zarevac CreditAttribution: Zarevac commented#3: 1431452-ambiguos-status.patch queued for re-testing.
Comment #8
superthin CreditAttribution: superthin commentedDrupal 7.12 when visiting my site http://mysite.com/forum
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous: SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => vi [:db_condition_placeholder_2] => und ) trong advanced_forum_forum_load() (dòng 142 của /var/www/clients/client1/web29/web/sites/all/modules/advanced_forum/includes/core-overrides.inc).
Comment #9
superthin CreditAttribution: superthin commentedDrupal 7.12 when visiting my site http://mysite.com/forum
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous: SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => vi [:db_condition_placeholder_2] => und ) trong advanced_forum_forum_load() (dòng 142 của /var/www/clients/client1/web29/web/sites/all/modules/advanced_forum/includes/core-overrides.inc).
Comment #10
Schnittmenge CreditAttribution: Schnittmenge commentedI tested drupal 8 with that patch and I had no errors.
Comment #11
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x.
Comment #12
kerios83 CreditAttribution: kerios83 commentedhttp://drupal.org/node/1437932
Comment #13
webflo CreditAttribution: webflo commentedIts not committed to 7.x. I rolled a patch for d7.
Comment #14
webflo CreditAttribution: webflo commentedGo testbot!
Comment #15
webflo CreditAttribution: webflo commentedGo testbot!
Comment #16
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedThe patch name must not end in -D# if you want testbot to queue it :)
Comment #17
webflo CreditAttribution: webflo commentedThanks :)
Comment #18
webflo CreditAttribution: webflo commentedwoho.
Comment #19
Yannick Menard CreditAttribution: Yannick Menard commentedGetting this too after applying patch #3 :
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node.tid' in 'on clause': SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (n.status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => en [:db_condition_placeholder_2] => und ) in forum_forum_load() (line 780 of /modules/forum/forum.module).
Comment #20
Anonymous (not verified) CreditAttribution: Anonymous commentedApplied 1431452-ambiguos-status.patch in D-7.12 release. Multilingual site, still getting same error msg:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous: SELECT f.tid AS tid, COUNT(n.nid) AS topic_count, SUM(ncs.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {node} node ON f.tid = node.tid WHERE (status = :db_condition_placeholder_0) AND (n.language IN (:db_condition_placeholder_1, :db_condition_placeholder_2)) GROUP BY tid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => en [:db_condition_placeholder_2] => und ) in advanced_forum_forum_load() (line 142 of /home1/reallig1/public_html/sites/all/modules/advanced_forum/includes/core-overrides.inc).
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commentedJust a note to let you know the patch i18n-clean_select_api-1437932-25.patch repaired the problem: http://drupal.org/node/1437932 . It is a lengthy, complex, and somewhat confusing patch to apply, but it does seem to work. I can now access my forums.
Comment #22
larowlanPutting it back how it was
Comment #23
xjmComment #24
webchickHm. I committed and pushed this to 7.x to get us parity with 8.x, however...
Why was this error not caught by our existing forum tests? We need the tests expanded so they would catch this in the future, because we /did/ run the full test suite against that security patch before it went in.
Comment #25
Jose Reyero CreditAttribution: Jose Reyero commentedThese issues only show up when a contrib module uses the query_alter() hook and joins in some more table.
I think the proper fix for this would be improving the query builder so it adds a table alias to every field in the query, this would me much more friendly with modules implementing query alter hooks.
The Internationalization related issue has been fixed, btw, #1437932: Multilingual select 7.x-1.4 module cause PDOException on drupal forum
Before joining in any other table, we are now adding table alias for fields without one when possible, that is if there's a single table.
Comment #26
xjmAh, thank you @Jose Reyero! I was at a loss for how to reproduce this. So actually this is not a core bug at all; it is a bug with the module adding the query alter, and this should be reverted in core, perhaps in favor of a more complete solution for table aliasing generally.
Can you provide an example of a module that causes the issue?
Comment #27
webchickI don't think the extra specificity in the core query really harms anything. But it indeed sounds like as far as core's concerned, there's nothing more to do here. We don't need tests to show how well we babysit broken code.
Comment #28
Bitbull CreditAttribution: Bitbull commentedUnfortunately, the mentioned patch failed to meet dependancies with me:
Working with latest version of Drupal (7.12) and i18n module (7.x-1.4) as well, and all multilingual modules enabled.
So, is it acceptable to change status to 'needs work' (as patch mentioned in topic didn't work either - see comment #6)?
Comment #29
xjm@Bitbull -- The patch was committed to Drupal core, not i18n. If there's an issue with i18n, you should file it in that module's queue. Thanks!
Comment #30
Bitbull CreditAttribution: Bitbull commented@xjm -- I was actually replying to comment #21, stating that http://drupal.org/files/i18n-clean_select_api-1437932-25.patch repaired the problem. And as the versions match with mine (latest at this very moment) and the patch stated in #21 fails to apply on my installation (see output on comment # 26), and that the patch submitted in this topic (#17) throws the problem mentioned in #20, I unfortunately have still no solution to the problem ...
Comment #31
xjmPlease follow up in the i18n issue, which is where that patch is from. #1437932: Multilingual select 7.x-1.4 module cause PDOException on drupal forum.