Issue Task Under Review

#111660Set pid of domain objects without calling setPid() in persistence backend

Alexander Schnitzler 11/29/26, 18:43 updated 11/29/26, 19:21

Description

Extbase writes the properties of domain objects via reflection (ReflectionService::setRawEntityPropertyValue()), bypassing setters: getters and setters are userland code, and the framework does not go through them when it sets values. DataMapper sets uid, pid and all mapped properties this way, and Backend does the same for uid after inserting a row. The only methods of the model API the framework relies on are the getters getUid() and getPid().

The persistence backend is inconsistent here: it writes the page id back by calling the public setter setPid() (Backend::insertObject() after adding the row, and when inline children move with their parent to another page). A model that overrides setPid() (validation, side effects, a different meaning) therefore changes how Extbase persists records.

Proposal

Set pid in Backend via ReflectionService::setRawEntityPropertyValue(), like uid. The moved inline children must still be detected as dirty and written with the new page id.

setPid() itself stays as it is; this change only stops Extbase from calling it.

Reviews 1

History 02

  1. Gerrit Code Review pushed patch set 1 for main to change 98198 status New Under Review 11/29/26, 19:02

  2. Gerrit Code Review pushed patch set 2 for main to change 98198 11/29/26, 19:21