Issue Bug Resolved

#111139Repository: update() and remove() of a lazy-loaded relation fail

Alexander Schnitzler 10/19/26, 06:22 updated 10/23/26, 05:20

Description

Since Extbase uses native PHP lazy objects for lazy loading
(“[FEATURE] Use native PHP lazy objects for Extbase lazy loading”),
a lazy 1:1 or n:1 relation returns a native lazy proxy of the
target class. Passing that proxy to its repository fails.

update() throws, for an uninitialized and for an initialized proxy:

$blog = $blogRepository->findByUid(3);
$administrator = $blog->getAdministrator(); // lazy proxy
$administrator->setName(‘changed’);
$administratorRepository->update($administrator);
UnknownObjectException (1249479819): The object of type
“…\Administrator” given to update must be persisted already,
but is new.

remove() silently does nothing: the record is not deleted and no
exception is thrown.

$administratorRepository->remove($blog->getAdministrator());
$persistenceManager->persistAll();
// fe_users record 3 is still not deleted

Updating the parent ($blogRepository->update($blog)) persists
changes on the related object correctly.

Cause: Session::hasObject() checks the identity map by object
instance. The DataMapper registers only the real instance that the
proxy resolves to, never the proxy itself. So isNewObject() returns
true and getIdentifierByObject() returns null for the proxy, and
the backend skips it on remove.

Expected: A lazy proxy created by the DataMapper is treated as the
persisted object it stands for, without initializing an
uninitialized proxy (its uid is already set).

Reviews 2

History 24

  1. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-23T05:20:12+00:00" > 10/23/26, 05:20 </span>

    Applied in changeset commit:b74a24ceefffff900ecdb133e9b25e682f9f3bca.