Review main Merged

76550[FEATURE] Add new possibilities to modify DefaultUploadFolder settings

Andreas Nedbal CR +2 V +2 Hard +564 −10 updated 03/23/23, 09:59

Commit message

Before this change the resolving of the default upload folder
was done in BackendUserAuthentication. As new users wished for
additional ways to configure the default upload folder (e.g.
per page, per record, etc.), it started to not make sense that
the logic is present in the backend user.

The DefaultUploadFolderResolver uses the same logic as before
including a new `options.defaultUploadFolder` PageTSconfig setting,
allowing to change this setting on a per-page level.

In addition, a new PSR-14 event
`AfterDefaultUploadFolderWasResolvedEvent` is introduced
receiving the same arguments as the hook in BackendUserAuthentication named

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder']

which serves the same purpose. This way, the upload folder
can also be modified by PHP developers.

Review

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

Issues 1

Files 13

Review log 2946

Show 1221 earlier messages
  1. Andreas Nedbal uploaded patch set 1 11/10/22, 22:00

  2. Andreas Nedbal updated the commit message in patch set 2 11/10/22, 22:01

  3. core-ci voted on patch set 1 V -1 11/10/22, 22:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33535

  4. core-ci voted on patch set 2 V -1 11/10/22, 22:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33536

  5. Benni Mack uploaded patch set 3 11/11/22, 08:12

  6. core-ci voted on patch set 3 V -1 11/11/22, 08:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33550

  7. Andreas Nedbal uploaded patch set 4 11/11/22, 09:27

  8. core-ci voted on patch set 4 V -1 11/11/22, 09:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33555

  9. Andreas Nedbal uploaded patch set 5 11/11/22, 09:52

  10. core-ci voted on patch set 5 V +1 11/11/22, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33557

  11. Andreas Nedbal uploaded patch set 6 11/11/22, 13:05

  12. core-ci voted on patch set 6 V +1 11/11/22, 13:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33586

  13. Andreas Nedbal uploaded patch set 7 11/11/22, 13:41

  14. core-ci voted on patch set 7 V +1 11/11/22, 13:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33587

  15. Georg Ringer commented on patch set 7 11/14/22, 09:23

    I know it is just a WIP yet ;) please also don't forget the rst for the event! thanks!

    DefaultUploadFolderResolver.php:38

    please add the types: int $pid = null, string $table = null, string $field = null
  16. Andreas Nedbal uploaded patch set 8 V +1 11/28/22, 11:26

  17. core-ci voted on patch set 8 V +1 11/28/22, 11:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34314

  18. Andreas Nedbal commented on patch set 8 11/28/22, 11:44

    DefaultUploadFolderResolver.php:38 Reply

    Done, added the types!
  19. Benni Mack updated the commit message in patch set 9 V +1 12/01/22, 22:53

  20. core-ci voted on patch set 9 V +1 12/01/22, 23:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34530

  21. Andreas Nedbal uploaded patch set 10 V +1 12/02/22, 09:17

  1. core-ci voted on patch set 10 V -1 12/02/22, 09:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34543

  2. Andreas Nedbal uploaded patch set 11 V -1 12/02/22, 09:29

  3. core-ci voted on patch set 11 V +1 12/02/22, 09:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34544

  4. Chris Müller uploaded patch set 12 V +1 12/04/22, 18:09

  5. Chris Müller commented on patch set 12 12/04/22, 18:12

    Just a question: As the new PSR-14 event replaces the hook "getDefaultUploadFolder", will the hook be deprecated? And if yes, then we need also a deprecation rst.
  6. core-ci voted on patch set 12 V +1 12/04/22, 18:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34608

  7. Benni Mack commented on patch set 12 12/04/22, 20:06

    Reply

    I think we should deprecate the whole method in a separate patch
  8. Benni Mack commented on patch set 13 V +1 12/06/22, 10:49

    Published edit on patch set 12.
  9. core-ci voted on patch set 13 V +1 12/06/22, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34708

  10. Jörg Bösche voted on patch set 13 CR +1 01/13/23, 09:51

  11. Chris Müller uploaded patch set 14 CR +1 V +1 02/08/23, 17:54

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

  13. Benni Mack uploaded patch set 15 V +1 03/22/23, 21:36

  14. Benni Mack uploaded patch set 16 03/22/23, 21:42

  15. Benni Mack voted on patch set 16 V +1 CR +1 03/22/23, 21:42

  16. core-ci voted on patch set 15 V +1 03/22/23, 21:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39419

  17. core-ci voted on patch set 16 V +1 03/22/23, 21:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39420

  18. Guido Schmechel commented on patch set 16 03/22/23, 22:58

    BackendUserAuthentication.php:1610

    FormEngine

    DefaultUploadFolderResolver.php:107

    Do we need a $storage->isOnline() check? I think especially about remote storages. Although it has also been used without isOnline() up to now. ;-)
  19. Georg Ringer uploaded patch set 17 CR +1 V +1 03/23/23, 06:26

  20. Georg Ringer commented on patch set 17 V +1 CR +1 03/23/23, 06:26

    BackendUserAuthentication.php:1610 Reply

    Done
  21. core-ci voted on patch set 17 V +1 03/23/23, 07:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39441

  22. Benni Mack commented on patch set 17 V +2 CR +2 03/23/23, 08:34

    DefaultUploadFolderResolver.php:107 Reply

    let's leave it out for the time being.
  23. Benni Mack merged patch set 18 03/23/23, 08:34

  24. Stephan Großberndt commented on patch set 18 03/23/23, 09:16

    Does this make https://github.com/beechit/default_upload_folder#readme obsolete completely? The example in the feature.rst is only for a page, but using typoscript conditions it might also be used to configure a different upload folder per column of a table of an extension as well?
  25. Benni Mack commented on patch set 18 03/23/23, 09:59

    Reply

    nope. all features of the extension are not incorporated yet, but I think this change can easily be added in a followup, in case you're interested ;)