Issue Task Closed

#110795Pin Extbase persistence behaviour in an outcome-based conformance suite

Alexander Schnitzler 09/25/26, 16:42 updated 10/20/26, 12:39

Description

Why

The refactorings of this epic and the bug fixes after them need an oracle that states what Extbase does today in terms of records and rows: which records a query returns per language and workspace, which row a write hits, which events fire. Today that knowledge lives in Typo3DbQueryParserTest (SQL fragments), in scattered functional tests written per bug, and in nobody’s head for the write paths. The persistence files have 240 to 330 commits each since 2009; the language-aware identity map (2026) and the LIMIT/overlay fixes changed behaviour that has no outcome test.

What

One new functional test class, typo3/sysext/extbase/Tests/Functional/Persistence/BehaviourConformanceTest.php, with one CSV fixture (Fixtures/BehaviourConformanceTestImport.csv) that contains blogs, posts, tags and comments in three languages and one workspace, grown over four patches:

  1. Language overlays. Fixture and class; rows selected per overlay mode (off, on, on with floating, mixed) and their overlay; dropped rows; identity fields (uid, _localizedUid, _versionedUid) of an overlaid record and of its n:1, 1:n and m:n relations; relations loaded under the parent’s language aspect; records in “all languages”; a translated uid re-based onto the default uid; the identity map key including the overlay type; findByUid(2) and findByUid(11) in one request yield two objects with the same uid; count vs. fetch and LIMIT with overlays (asserted as today, marked as quirks).
  2. Workspace reads and writes. Overlay of versions, new records, placeholders and hidden versions; hidden versions and hidden live records with ignored enable fields; a single moved record resolves to its move pointer, in lists it is dropped; relations and MM rows of a version replace those of the live record; an update inside a workspace writes the live row (asserted as today).
  3. Write targets and event order. Insert: pid from storagePid, crdate/@tstamp@ from the request time, l10n_parent = 0, MM sorting_foreign in insertion order. Update: a translated object outside a workspace writes the translation row, _languageUid preserved. Delete: removing a translated object soft-deletes the default-language row (asserted as today, marked). ModifyQueryBeforeFetchingObjectDataEvent and ModifyResultAfterFetchingObjectDataEvent strictly alternate.
  4. Coverage gaps. Raw Query::statement() with a SQL string and with a QueryBuilder; empty IN list throws; != and an unsupported operator through QueryObjectModelFactory::comparison(); partial enableFieldsToBeIgnored list bypasses only the named field; includeDeleted.

54 test methods. Every known inconsistency is asserted exactly as it behaves today and carries a todo@ with the issue that will change it, so a later fix flips one assertion instead of discovering the behaviour.

What does not change

Nothing under Classes/. Existing tests (QueryLocalizedDataTest, WorkspaceTest, IsDirtyTest, Typo3DbQueryParserTest) are untouched.

Findings while writing it

  • One findByUid() on a post dispatches ten before/after pairs of the fetch events, one per relation query touched while hydrating. The test asserts alternation, not a count.
  • The QueryBuilder branch inside Typo3DbBackend::getObjectDataByRawQuery() is unreachable from the public API: a QueryBuilder statement is executed on an earlier path in getObjectDataByQuery().
  • MM row deletion for a parent table without a soft-delete column (deleteAllRelationsFromRelationtable) cannot be reached with the blog example fixtures; every table there has a delete column. Needs its own fixture table, left to the write-target fix.

Not covered

pages and sys_file_metadata overlays (no model in the test extension), the optional LEFT JOIN on a hidden related row, the newRecordStoragePid override. Data sets touched by change 94510 (strict fallback) are marked so their expectations get updated when it merges.

How to review

Start with the data providers of the overlay-mode and workspace tests; the fixture header comment lists which record exists in which language and workspace. Then read the three “known hole” tests and every todo@: each names the issue that will flip it. Run: Build/Scripts/runTests.sh -s functional -d sqlite typo3/sysext/extbase/Tests/Functional/Persistence/BehaviourConformanceTest.php.

Reviews 2

Subtasks 4

History 5

  1. Alexander Schnitzler commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-20T12:39:59+00:00" > 10/20/26, 12:39 </span>

    Closed after steps 1 (#110797) and 2 (#110798). Steps 3 and 4 were superseded: the conformance suite pinned today’s Extbase behaviour, including where it differs from the core. Further coverage compares Extbase with the core in pairs, one ticket per topic below #110794. The tests of BehaviourConformanceTest are replaced topic by topic by those pairs.