Problem/Motivation
\Drupal\Core\Entity\Query\Sql\Query::__toString() omits the alter() call that execute() makes. The string therefore lacks all alter-hook additions and does not represent the executed query.
Steps to reproduce
Look at the output of (string) $query for an entity query that has been altered via hook_entity_query_alter() and notice the alterations are not there.
Proposed resolution
Fix it :)
Remaining tasks
Review.
User interface changes
Nope.
Introduced terminology
N/A
API changes
Nope.
Data model changes
Nope.
Release notes snippet
N/A
Issue fork drupal-3593346
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3593346-entity-query-tostring
changes, plain diff MR !15967
Comments
Comment #3
amateescu commentedComment #4
smustgrave commentedRan the test-only locally since I can't in the pipeline
Change itself looks fine. My only open question is if this needs a CR? It is a bug so people may assume it works but not sure. Won't hold the ticket up though.
Comment #5
larowlanLeft a question on the MR
Comment #6
amateescu commentedThanks for reviewing, @larowlan! Answered and fixed your point :)
@smustgrave, I don't think this needs a CR.
Comment #10
larowlanCommitted and pushed ed5dfebdddc to main and 55aa4066c86 to 11.x. Backported to 11.4.x.
Thanks!