The query used on the /node page (default home page) does not query alias for the fields in the condition. This mean that if that query is altered (say to add a revision table) then there are ambiguous fields.

In general it seems like best practice to use aliases.

Files: 
CommentFileSizeAuthor
#8 1728568_add_alias_to_node_query_d8.patch774 bytese2thex
PASSED: [[SimpleTest]]: [MySQL] 39,971 pass(es).
[ View ]
#6 1728568_add_alias_to_node_query_d8.patch774 bytese2thex
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1728568_add_alias_to_node_query_d8_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#3 table-alias-1728568-3.patch774 bytesoriol_e9g
FAILED: [[SimpleTest]]: [MySQL] 38,800 pass(es), 2 fail(s), and 2 exception(s).
[ View ]
#1 1728568_add_alias_to_node_query.patch761 bytese2thex
PASSED: [[SimpleTest]]: [MySQL] 39,344 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new761 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,344 pass(es).
[ View ]

The attached patch just adds the alias to the fields.

Status:Needs review» Reviewed & tested by the community

This patch works and fixes the issue I had with a query alter.

Version:7.15» 8.x-dev
Status:Reviewed & tested by the community» Needs review
StatusFileSize
new774 bytes
FAILED: [[SimpleTest]]: [MySQL] 38,800 pass(es), 2 fail(s), and 2 exception(s).
[ View ]

Go to fix first in D8

Title:/node query does not alais fields in conditionsAdd table alias in node query conditions to avoid ambiguous fields

Status:Needs review» Needs work

The last submitted patch, table-alias-1728568-3.patch, failed testing.

Version:8.x-dev» 7.15
Status:Needs work» Needs review
StatusFileSize
new774 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1728568_add_alias_to_node_query_d8_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

rolled for d8

Status:Needs review» Needs work

The last submitted patch, 1728568_add_alias_to_node_query_d8.patch, failed testing.

Version:7.15» 8.x-dev
Status:Needs work» Needs review
StatusFileSize
new774 bytes
PASSED: [[SimpleTest]]: [MySQL] 39,971 pass(es).
[ View ]

rolled for d8 and i change the version

Issue tags:+lsd-csi

tagging as part of lsd project

Status:Needs review» Reviewed & tested by the community

Still looks good in d8.

Status:Reviewed & tested by the community» Fixed

This seems like reasonable hardening that shouldn't hurt anything.

Committed and pushed to 8.x and 7.x. Thanks!

Issue tags:+needs backport to D7

Retroactively tagging.

Status:Fixed» Closed (fixed)

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

Issue tags:+7.17 release notes

Adding this to the release notes and CHANGELOG.txt, since this is an alterable query so it could possibly affect some existing code which uses hook_query_alter() to examine/change it.