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.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1728568_add_alias_to_node_query_d8.patch | 774 bytes | e2thex |
#6 | 1728568_add_alias_to_node_query_d8.patch | 774 bytes | e2thex |
#3 | table-alias-1728568-3.patch | 774 bytes | oriol_e9g |
#1 | 1728568_add_alias_to_node_query.patch | 761 bytes | e2thex |
Comments
Comment #1
e2thex CreditAttribution: e2thex commentedThe attached patch just adds the alias to the fields.
Comment #2
indytechcook CreditAttribution: indytechcook commentedThis patch works and fixes the issue I had with a query alter.
Comment #3
oriol_e9gGo to fix first in D8
Comment #4
oriol_e9gComment #6
e2thex CreditAttribution: e2thex commentedrolled for d8
Comment #8
e2thex CreditAttribution: e2thex commentedrolled for d8 and i change the version
Comment #9
e2thex CreditAttribution: e2thex commentedtagging as part of lsd project
Comment #10
indytechcook CreditAttribution: indytechcook commentedStill looks good in d8.
Comment #11
webchickThis seems like reasonable hardening that shouldn't hurt anything.
Committed and pushed to 8.x and 7.x. Thanks!
Comment #12
webchickRetroactively tagging.
Comment #14
David_Rothstein CreditAttribution: David_Rothstein commentedAdding 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.