Review main Merged

82404[TASK] Consider soft delete in file reference delete method

Torben Hansen CR +2 V +2 Normal +86 −27 updated 08/06/24, 09:12

Commit message

With #102770 the `delete()` method for a FileReference object has
been implemented. This was however performed using a hard delete
of the file reference record in the database, which is not
appropriate, since the delete functionality must take into account,
if the table is configured for soft or hard deletes.

This patch changes the implementation, so the file reference is
either hard or soft deleted depending on the TCA configuration.
If the delete operation was successful, the reference index
for affected records is now updated. Additionally, functional
tests are extended to ensure, that the file used in the file
reference remains when the file reference is deleted and that
the reference index is updated accordingly.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 6

Review log 2536

Show 711 earlier messages
  1. Torben Hansen uploaded patch set 1 01/08/24, 18:24

  2. Torben Hansen updated the commit message in patch set 2 01/08/24, 18:24

  3. core-ci voted on patch set 1 V -1 01/08/24, 18:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51278

  4. core-ci voted on patch set 2 V -1 01/08/24, 18:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51279

  5. Torben Hansen uploaded patch set 3 V -1 01/08/24, 18:43

  6. core-ci voted on patch set 3 V -1 01/08/24, 18:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51280

  7. Torben Hansen uploaded patch set 4 V -1 01/09/24, 06:32

  8. core-ci voted on patch set 4 V +1 01/09/24, 06:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51297

  9. Mathias Brodala commented on patch set 4 01/09/24, 07:37

    FileReference.php:390

    Strictly speaking this must actually check TCA if ctrl/delete is set and what field it contains. Otherwise an instance which intentionally disables soft-delete for file references will malfunction here. As usual if soft-delete is not enabled, a hard-delete must be performed.
  10. Torben Hansen uploaded patch set 5 V +1 01/09/24, 10:09

  11. Torben Hansen commented on patch set 4 01/09/24, 10:09

    FileReference.php:390 Reply

    Done
  1. core-ci voted on patch set 5 V +1 01/09/24, 10:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51317

  2. Oli Bartsch commented on patch set 5 01/09/24, 10:22

    Just curios.

    FileReference.php:384

    Why do we not just use DataHandler API here?
  3. Stefan Bürk commented on patch set 5 01/09/24, 10:28

    FileReference.php:384 Reply

    FAL API is also used in FE context, using DataHandler is thereore not possible.
  4. Mathias Brodala commented on patch set 5 01/09/24, 10:56

    FileReference.php:387

    Since we always use a connection we could retrieve this only once.

    FileReference.php:391

    You need to use the configured field from TCA here.
  5. Torben Hansen uploaded patch set 6 V +1 01/11/24, 18:28

  6. Torben Hansen commented on patch set 5 01/11/24, 18:28

    FileReference.php:387 Reply

    Done

    FileReference.php:391 Reply

    Done
  7. core-ci voted on patch set 6 V +1 01/11/24, 18:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51457

  8. Torben Hansen commented on patch set 6 01/18/24, 18:41

    FileReference.php:384 Reply

    Done
  9. Torben Hansen uploaded patch set 7 V +1 02/27/24, 17:39

  10. core-ci voted on patch set 7 V -1 02/27/24, 17:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53651

  11. Torben Hansen uploaded patch set 8 V -1 02/27/24, 17:50

  12. core-ci voted on patch set 8 V +1 02/27/24, 17:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53654

  13. Simon Schaufelberger commented on patch set 8 03/27/24, 09:29

    tests
  14. Torben Hansen updated the commit message in patch set 9 V +1 03/27/24, 09:30

  15. Torben Hansen commented on patch set 9 03/27/24, 09:30

    Reply

    Done
  16. core-ci voted on patch set 9 V -1 03/27/24, 09:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54989

  17. Torben Hansen rebased onto patch set 10 V -1 03/27/24, 09:37

  18. core-ci voted on patch set 10 V +1 03/27/24, 09:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54990

  19. Jörg Bösche voted on patch set 10 CR +1 04/04/24, 06:34

  20. Torben Hansen uploaded patch set 11 CR +1 V +1 08/06/24, 08:24

  21. core-ci voted on patch set 11 V +1 08/06/24, 08:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62881

  22. Christian Kuhn voted on patch set 11 CR +1 V +1 08/06/24, 08:49

  23. Stefan Bürk voted on patch set 11 CR +1 V +1 08/06/24, 08:57

  24. Christian Kuhn voted on patch set 11 CR +2 V +2 08/06/24, 09:12

  25. Christian Kuhn merged patch set 12 08/06/24, 09:12