Review main Merged

96920[TASK] Compare written field values in Extbase with DataHandler

Alexander Schnitzler CR +2 V +2 Expert +2032 −0 updated 10/20/26, 19:29

Commit message

A value written through an Extbase repository and the same value
saved in the backend should end up the same in the database. This adds
FieldValuesTest, FieldTypeValuesTest and TimestampTest with pairs of
functional tests on blog_example: a ByCore test sends the value
through DataHandler as an admin, a ByExtbase test sets it on a model
and persists it, both expect the same row.

The pairs cover eval trim, max, range, required, unique, uniqueInPid,
email, datetime fields stored as timestamp, native date and datetime
columns and the date format, number fields, password, uuid and slug
fields (uniqueInPid, uniqueInSite), TCA defaults, nullable fields and
tstamp and crdate of created and changed records.

Extbase differs from DataHandler in fourteen of them, and in one more
on PostgreSQL only. Those ByExtbase tests are skipped and describe
the difference:
- eval trim is not applied
- max of an input field is not applied
- range.lower of a number field is not applied
- an empty value of a required field overwrites the old value
- eval unique and uniqueInPid are not applied
- an invalid email address is stored as it is
- on PostgreSQL, a non-numeric string for a number field is rejected
  by the database instead of stored as 0
- a password is stored as plain text
- no uuid is generated for an empty uuid field
- no slug is generated from the title
- eval uniqueInPid and uniqueInSite of slug fields are not applied
- TCA defaults of a new record are not applied
- crdate is overwritten with 0 by a model property of the same name

blog_example gets a table for field values, a table with a uuid field
and a table with a crdate property, for the cases the existing tables
do not cover.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 2

Files 41

Show 21 more files

Review log 78

  1. Alexander Schnitzler uploaded patch set 1 10/20/26, 14:35

  2. core-ci voted on patch set 1 V +1 10/20/26, 14:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111850

  3. Alexander Schnitzler marked it ready for review 10/20/26, 14:50

  4. Alexander Schnitzler wrote 10/20/26, 15:22

    Topic set to extbase
  5. Alexander Schnitzler commented on patch set 1 10/20/26, 15:54

    A note up front: I'm not sure myself whether all of these pairs describe behaviour Extbase should adopt. TCA eval is how the backend form processes input, while Extbase writes usually come from frontend input that runs through Extbase validators. Roughly, the pairs fall into three groups: 1. Data integrity: password hashing, unique/uniqueInPid, generating uuid and slug values, TCA defaults of new records, crdate. If Extbase skips these, the database ends up with wrong or duplicate data. I think these are the strongest case for following DataHandler. 2. Input normalisation: trim, max, range.lower, email. One could argue this is validation and belongs to Extbase validators, not to the persistence layer. 3. Required fields: an empty value overwriting the old value of a required field sits somewhere in between. If group 2 (or 3) should not be expected from Extbase, I'd rather drop those pairs than pin them as differences. Opinions welcome.
  6. Benni Mack commented on patch set 1 10/20/26, 16:13

    Reply

    that is correct. I typically call it: - Validation - Sanitization / Normalization We really need to validate, but DAtaHandler cannot deal with required fields properly set, this is something we need to improve in v15/v16 still. So: 3 Should be handled on the Domain Level in Extbase for the time being.
  7. Benni Mack commented on patch set 1 CR +2 V +2 10/20/26, 19:29

    Reply

    Done
  8. Benni Mack merged patch set 2 10/20/26, 19:29