Review main Merged

85110[BUGFIX] Editors should be allowed to delete files attached to meta data

Georg Ringer CR +2 V +2 Normal +150 −16 updated 11/12/26, 18:39

Commit message

If file references are attached to `sys_file_metadata` the current check
must be modified because there is no parent page attached to the record.

This patch just makes the delete button available for this edge case -
it has already been visible if a reference is attached to e.g. a
content element.

Review

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

Issues 1

Files 3

Review log 2735

Show 810 earlier messages
  1. Georg Ringer uploaded patch set 1 07/05/24, 07:33

  2. Georg Ringer commented on patch set 1 07/05/24, 07:33

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 07/05/24, 07:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61019

  4. Markus Klein voted on patch set 1 CR +1 07/23/24, 14:10

  5. Benni Mack updated the commit message in patch set 2 CR +1 V +1 10/18/24, 13:39

  6. Ernesto Baschny commented on patch set 2 01/08/25, 15:36

    Similar problem also happen with the other icons which also require "edit rights" and could be also considered by this patch: hide/unhide, sort.up, sort.down Should that be fixed here too? Same context, same bug... I solved it for v11 here: https://github.com/baschny/typo3/pull/2 - but the v13 patch needs to be different.
  7. Benni Mack rebased onto patch set 3 02/12/25, 08:16

  8. core-ci voted on patch set 3 V +1 02/12/25, 08:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74034

  9. Simon Schaufelberger voted on patch set 3 CR +1 V +1 07/18/25, 06:28

  10. Benni Mack rebased onto patch set 4 CR +1 V +1 09/12/25, 09:14

  1. core-ci voted on patch set 4 V +1 09/12/25, 09:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84902

  2. Anton Danilov commented on patch set 4 CR -1 10/01/25, 14:17

    I’d like to raise a concern regarding the hard-coded usage of the "sys_file_metadata" table name in the logic. Instead of explicitly checking for "sys_file_metadata", I suggest that the logic should be based on TCA configuration - specifically, checking the TCA option `ignoreRootLevelRestriction`: ``` ($parentPageRowUid === 0 && $this->getBackendUserAuthentication()->check('tables_modify', self::FILE_REFERENCE_TABLE) && ($fileReferenceTableTca['ctrl']['security']['ignoreRootLevelRestriction'] ?? false))) ```
  3. Anton Danilov voted on patch set 4 CR +1 10/02/25, 09:09

  4. Anton Danilov wrote 10/02/25, 09:09

    Removed Code-Review+1 by Anton Danilov
  5. Anton Danilov voted on patch set 4 CR -1 10/02/25, 09:10

  6. Benni Mack updated the commit message in patch set 5 CR -1 V +1 04/22/26, 06:56

  7. core-ci voted on patch set 5 V -1 04/22/26, 11:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100836

  8. Anton Danilov uploaded patch set 6 V -1 05/21/26, 14:50

  9. Anton Danilov commented on patch set 6 05/21/26, 14:53

    Reply

    Done
  10. core-ci voted on patch set 6 V +1 05/21/26, 15:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/102329

  11. Stefan Bürk uploaded patch set 7 V +1 08/03/26, 10:43

  12. Stefan Bürk commented on patch set 7 08/03/26, 10:49

    Patch set 7 adds a functional test. The production diff is byte-identical to patch set 6; ps6 -> ps7 additionally rebases onto the current main tip. FileReferenceContainer had no test coverage at all so far. The new FileReferenceContainerTest follows the pattern of the existing FilesControlContainerTest in the same directory: the container is taken from the DI container, fed a prepared $this->data via setData(), rendered, and the resulting HTML is asserted on. Four cases: * file reference without parent page (root level), editor with tables_modify=sys_file_reference -> delete control is rendered. This is the regression test for #99516. * same, but editor without tables_modify on sys_file_reference -> no control. * parent page without CONTENT_EDIT permission -> no control. * parent page with CONTENT_EDIT permission -> control is rendered. The last three are guards: they pin down that the new root level branch does not widen permissions and does not leak into the regular page based path. Reverting only the production hunk while keeping the test class makes exactly one test fail - the regression test - while the three guards keep passing (Tests: 4, Assertions: 4, Failures: 1). Locally green: functional on sqlite and mariadb (4 tests each), cgl, cglHeaderGit, phpstan, checkIntegrityPhp. One detail worth knowing when extending the test: the delete control is additionally gated by ModifyFileReferenceEnabledControlsEvent, whose state is taken from inlineParentConfig.appearance.enabledControls. Without 'enabledControls' => ['delete' => true] in the data array the control is never rendered and the assertions would pass vacuously.
  13. core-ci voted on patch set 7 V +1 08/03/26, 10:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105885

  14. Anton Danilov uploaded patch set 8 V +1 11/03/26, 09:55

    Rebased onto current main and resolved the merge conflict. * The four cases are one data-provider test now, so the permission matrix reads as a table instead of four near-identical bodies, and each data set label names its scenario. * The three fixture files became one multi-table Fixtures/FileReferenceContainer.csv because the tables are only meaningful together. main's tests keep the shared be users.csv: its admin is uid 1, while the new fixture needs uid 1 to be a non-admin editor
  15. core-ci voted on patch set 8 V +1 11/03/26, 10:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113137

  16. Oliver Klee voted on patch set 8 V +1 11/03/26, 11:15

  17. Simon Schaufelberger voted on patch set 8 CR +1 V +1 11/09/26, 11:59

  18. Benni Mack voted on patch set 8 CR +1 V +1 11/10/26, 15:57

  19. Anton Danilov rebased onto patch set 9 CR +1 V +1 11/10/26, 16:14

  20. core-ci voted on patch set 9 V +1 11/10/26, 16:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113922

  21. Benni Mack voted on patch set 9 CR +1 V +1 11/10/26, 17:01

  22. Josua Vogel voted on patch set 9 CR +1 V +1 11/11/26, 07:08

  23. Oliver Klee voted on patch set 9 V +1 11/11/26, 08:40

  24. Benni Mack voted on patch set 9 CR +2 V +2 11/12/26, 18:39

  25. Benni Mack merged patch set 10 11/12/26, 18:39