Issue Bug New Orphaned

#91487Extbase repository query using equals on a relation field is different whether one passes $entity or $entity->getUid() in multi-language context

S P 05/26/20, 10:46 updated 07/08/24, 17:55

Description

The following two queries behave differently if in L>0 context:

$query->matching(
  $query->equals('relation', $entity)
)->execute()
$query->matching(
  $query->equals('relation', $entity->getUid())
)->execute()

When dumping $entity it is always displayed with the L=0 uid (also in L>0 context) and the overlayed fields from L>0, which is correct.

In L=0 context both queries behave the same. The second one works correct also in L>0, the first one only in L=0 context.

In L>0 context the first query extracts and uses the _localizedUid from the object. This is the bug afaik.

Discovered in 9, probably present in 10 as well.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Extbase repository query using equals on a relation field is different whether one passes $entity or $entity->getUid() in multi-language context Resolves: #91487 Releases: main