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.
Problem/Motivation
The test class in core/modules/node/tests/src/Functional/NodeRevisionPermissionsTest.php uses a regular database queries instead of using an entity queries.
Proposed resolution
Replace the regular database queries with an entity queries.
Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
Comment | File | Size | Author |
---|---|---|---|
#9 | 3151990-9.patch | 1.01 KB | daffie |
Comments
Comment #2
daffie CreditAttribution: daffie commentedPatch changes the db queries to entity queries.
Comment #3
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 commentedVerified this patch on local. Looks good to me.
Comment #4
pratik_kambleComment #5
pratik_kambleComment #7
catchIs this wasn't a test I'd have said we should do $query->execute() in the condition, but given it is a test there's no reason to optimise.
Committed/pushed to 9.1.x, thanks!
Comment #8
catchI missed this prior to commit, but both queries here need ->accessCheck(FALSE) since they're querying what's in the database as opposed to what can be shown to the current user.
Comment #9
daffie CreditAttribution: daffie commentedAdding the requested
->accessCheck(FALSE)
to both EntityQueries.Comment #10
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 commentedComment #11
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 commentedSorry, trying to assign other issue
Comment #12
Hardik_Patel_12 CreditAttribution: Hardik_Patel_12 at QED42 commentedBack to RTBC , accessCheck is added to both queries as suggested by @catch.
Comment #14
catchCommitted d7334ba and pushed to 9.1.x. Thanks!