Review main Merged

85975[BUGFIX] Remove invalid has-changed class on new records

Benjamin Kott CR +2 V +2 Easy +14 −7 updated 09/10/24, 12:17

Commit message

We are removing the misused has-changed class for new
records and replacing it with a dedicated is-new class.
This class is used only to check if a record needs to be
persisted before certain actions, such as closing or
previewing a record, can be executed.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Oli Bartsch +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Oli Bartsch +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 3

Files 3

Review log 78

  1. Benjamin Kott uploaded patch set 1 09/10/24, 09:05

  2. Andreas Kienast voted on patch set 1 CR +1 V +1 09/10/24, 09:07

  3. core-ci voted on patch set 1 V +1 09/10/24, 09:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65194

  4. Oli Bartsch commented on patch set 1 09/10/24, 09:35

    form-engine.ts:1035

    I don't think we need this here as newAction is not available for new records.

    form-engine.ts:1126

    I don't think we need this here as duplicateAction is not available for new records.
  5. Ayke Halder commented on patch set 1 09/10/24, 10:17

    form-engine.ts:1035 Reply

    Right now there is no new/duplication-button there, but this might get added in the future. So I would keep `… || FormEngine.isNew()` here and also for the duplication-action. The button itself also implements `const isNew`, and actually would set its own `data-is-new` attribute if added to a new record. See: https://github.com/TYPO3/typo3/blob/1607b8381cd343d30cca2e4a6e6cf84534b03596/typo3/sysext/backend/Classes/Controller/EditDocumentController.php#L1487-L1489 https://github.com/TYPO3/typo3/blob/1607b8381cd343d30cca2e4a6e6cf84534b03596/typo3/sysext/backend/Classes/Controller/EditDocumentController.php#L1525-L1527 And here the buttons `new` and `duplicate` are excluded for new records: https://github.com/TYPO3/typo3/blob/1607b8381cd343d30cca2e4a6e6cf84534b03596/typo3/sysext/backend/Classes/Controller/EditDocumentController.php#L1296-L1311 ---- If we go for "there is no button new/duplication for new records" we should cleanup the code above and remove the data-is-new attribute from EditDocumentController for the new/duplication-button and remove the `const ìsNew …`-handling here and for the duplication-action.
  6. Oli Bartsch commented on patch set 1 CR +1 V +1 09/10/24, 10:27

    form-engine.ts:1035 Reply

    Acknowledged

    form-engine.ts:1126 Reply

    Done
  7. Benjamin Kott voted on patch set 1 CR +2 V +2 09/10/24, 12:17

  8. Benjamin Kott merged patch set 2 09/10/24, 12:17