make sure it use the right target, simple fix, see patch :)

CommentFileSizeAuthor
forum_alias.patch514 bytesdroplet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

catch’s picture

Status: Reviewed & tested by the community » Needs review

Is there a reproducible bug from this query that could be tested?

droplet’s picture

Status: Needs review » Reviewed & tested by the community

exist query doesn't bring a bug but may have problem after query rewrite or other alters. can't be tested I thought

catch’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Quick fix +Needs tests

Tests were added for the same general issue in #766382: Column 'nid' is ambiguous when using node access modules, so it should be possible to re-use that work here.

droplet’s picture

umm #766382: Column 'nid' is ambiguous when using node access modules is a bug in exist Drupal Core.

This one made it better for contribute modules, may need some self custom query & alter the form/displays to test it, do it allowed/needed?

catch’s picture

The node_access_test module ought to be enough to trigger the bug I think. If it's not, then I'm fine with committing this without a test, but please try it first in case it does.

droplet’s picture

I have no idea.

#766382 join a node_access table which contains NID. NID is ambiguous at that case. but here we need to join a table with status cloumn.

#766382 query looks like:
SELECT n.nid, status FROM node n INNER JOIN node_access c ON n.nid = c.nid

this issue needs a query looks like this (comment table has status column):
SELECT n.nid, status FROM node n INNER JOIN comment c ON n.nid = c.nid

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

thursday_bw’s picture

Version: 8.8.x-dev » 7.x-dev
Issue summary: View changes
Issue tags: +Bug Smash Initiative

I dare say that with the function that this patch affects now deprecated and replaced, this issue is fixed for D8.
Changelog: https://www.drupal.org/node/2079767

I haven't checked but it probably still requires a backport to D7, so leaving open and changing the version.

Also tagging as bugsmash initiative because that's what brought me here.

Kristen Pol’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Needs tests, -Needs backport to D7

Triaging for Bug Smash Initiative.

This was already fixed in #1431452: Tests for 'status' in where clause is ambiguous so closing this.