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 concept of forward revisions was introduced in #218755: Support revisions in different states. Entity query currently returns zero results for any entity that has a forward revision.
For example, create node 1, vid 1, set to current revision. Create a new revision of that node (vid 2), but not set to the current revision. Entity query will return empty:
$nids = \Drupal::entityQuery('node')
->condition('nid', [1], 'IN')
->execute();
Attached is a test that illustrates the failure.
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#1 | entity-query-2465323-01-TEST-ONLY.patch | 1.22 KB | jhedstrom |
Comments
Comment #1
jhedstromThe test-only patch.
Comment #3
jhedstromThis is a duplicate of #2458543: Entity query age(EntityStorageInterface::FIELD_LOAD_REVISION) only gets current revision ID. The test here has been added to that patch.