Review main Merged

91934[BUGFIX] Show select icons for TCA folder config

Ayke Halder CR +2 V +2 Hard +250 −18 updated 12/09/25, 17:25

Commit message

It is possible to configure a select box to pull
icons from a folder in an extension. To do so,
the folder contents needs to be pulled in, but
for icons to be shown not the absolute file system
path must be provided to the icon API, but a
resource identifier.

For now a temporary fix is applied, so that the icons
are show again. To properly fix this without calling
internal API, the system resource API needs to be extended
with folder objects, with which resource identifiers from
within this folder can be pulled in.

Review

  • Code review CR +2 Done
    • Helmut Hummel +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Helmut Hummel +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 3

Review log 2942

Show 917 earlier messages
  1. Ayke Halder uploaded patch set 1 11/28/25, 15:57

  2. core-ci voted on patch set 1 V -1 11/28/25, 16:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91215

  3. Ayke Halder uploaded patch set 2 V -1 11/29/25, 15:42

  4. core-ci voted on patch set 2 V -1 11/29/25, 15:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91254

  5. Helmut Hummel commented on patch set 2 CR -1 11/29/25, 16:53

    ProjectResourceCollection.php:57

    No, we should not loosen it like this, as those paths only exist in classic mode and or make hard coded assumptions, that we want to get rid of eventually
  6. Ayke Halder uploaded patch set 3 CR -1 V -1 11/30/25, 00:22

  7. core-ci voted on patch set 3 V -1 11/30/25, 00:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91260

  8. Ayke Halder rebased onto patch set 4 V -1 11/30/25, 01:05

  9. core-ci voted on patch set 4 V +1 11/30/25, 01:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91273

  10. Helmut Hummel uploaded patch set 5 V +1 11/30/25, 12:33

  11. core-ci voted on patch set 5 V +1 11/30/25, 12:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91293

  12. Ayke Halder uploaded patch set 6 V +1 11/30/25, 14:23

  13. core-ci voted on patch set 6 V -1 11/30/25, 14:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91298

  14. Ayke Halder uploaded patch set 7 V -1 11/30/25, 16:24

  15. core-ci voted on patch set 7 V -1 11/30/25, 16:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91299

  16. Ayke Halder uploaded patch set 8 V -1 11/30/25, 16:49

  17. core-ci voted on patch set 8 V -1 11/30/25, 17:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91300

  1. Helmut Hummel commented on patch set 8 CR -1 11/30/25, 18:14

    SystemResourceIdentifierFactory.php:65

    fallback handling is in place in SystemResourceFactory and should not be implemented here as well! This Factory should only handle actual existing identifiers!
  2. Ayke Halder uploaded patch set 9 CR -1 V -1 12/01/25, 09:30

  3. Ayke Halder commented on patch set 9 12/01/25, 09:36

    SystemResourceIdentifierFactory.php:65 Reply

    Okay, now I get the idea behind SystemResourceFactory - removed the fallback here. And I also see the missing folder-path implementation you mentioned on Slack - marked the relative folder-path test as "skipped".

    ProjectResourceCollection.php:57 Reply

    Acknowledged
  4. Ayke Halder uploaded patch set 10 12/01/25, 09:38

  5. core-ci voted on patch set 9 V -1 12/01/25, 09:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91327

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

  7. Ayke Halder uploaded patch set 11 V -1 12/01/25, 09:48

  8. core-ci voted on patch set 11 V +1 12/01/25, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91330

  9. Helmut Hummel commented on patch set 11 12/01/25, 14:20

    TcaSelectItemsTest.php:670

    There is no non public path in classic mode, respectively default functional test cases. I also would not break out and write files outside the test instance, which is what you are doing here. Please remove this test.
  10. Helmut Hummel commented on patch set 11 12/01/25, 14:23

    AbstractItemProvider.php:277

    @mail@ayke-halder.de What is this for exactly? What are your thoughts behind re-setting the $folderResource from the identifier object?
  11. Ayke Halder commented on patch set 11 12/01/25, 18:27

    AbstractItemProvider.php:277 Reply

    * The PackageResourceIdentifier is initialized with the originally given config `$fileFolderConfig['folder']`. * The folder path is generated by PackageResourceIdentifier. * So in the end the associated folder resource should also be generated by the very same PackageResourceIdentifier. The originally given config value might not be identical with the folder resource which would be created by directly using the PackageResourceIdentifier. --- In context of relative paths: `$fileFolderConfig['folder'] = 'typo3temp/some/path/'` results in newly generated resource identifier `$folderResource = 'PKG:typo3/app:typo3temp/some/path/'` --- In context of `EXT:…` identifier: `$fileFolderConfig['folder'] = 'EXT:backend/Resources/Public/…'` results in newly generated resource identifier `$folderResource = 'PKG:typo3/cms-backend:Resources/Public/…'`

    TcaSelectItemsTest.php:670 Reply

    Unfortunately "the project path = the public path" in the context of the tests. The break out is bad: so no test for a non-public directory.
  12. Ayke Halder uploaded patch set 12 V +1 12/01/25, 18:27

  13. core-ci voted on patch set 12 V +1 12/01/25, 18:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91381

  14. Helmut Hummel commented on patch set 12 12/02/25, 09:05

    AbstractItemProvider.php:277 Reply

    > The originally given config value might not be identical with the folder resource which would be created by directly using the PackageResourceIdentifier. Since this value is provided by the user, this exact value should be used to register the icons. I suggest to remove this line then.
  15. Ayke Halder commented on patch set 12 12/02/25, 09:55

    AbstractItemProvider.php:277 Reply

    User provided *relative path* to folder must not be used for icon path - as icons do not support relative path per documentation. See Slack: https://typo3.slack.com/archives/C03AM9R17/p1764415227236729?thread_ts=1764342166.169259&cid=C03AM9R17 There we have the issue: `fileFolderConfig.folder` allows for relative path: https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Select/Single/Index.html#confval-select-single-filefolderconfig-folder > Specify the folder relative to the `\TYPO3\CMS\Core\Core\Environment::getPublicPath()`. See `getPublicPath()`. Alternatively use the prefix "EXT:" to point to an extension folder. `items.icon` only allows path prepended with `EXT:` https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Select/Single/Index.html#confval-select-single-items > icon (EXT: path or icon identifier) > Optional icon. For custom icons use a path prepended with `EXT:` to refer to an image file found inside an extension or use an registered icon identifier. How shall we proceed? * Disallow relative path for `fileFolderConfig.folder` (actually that is not working at the moment anyway)? * Allow relative paths for icons in items?
  16. Helmut Hummel commented on patch set 12 12/03/25, 08:59

    AbstractItemProvider.php:277 Reply

    The idea is, that all places with resources support the same way to reference resources. As documented in the feature rst for system resources, referencing relative paths are implemented (in a documented and limited way) and working in all places, including icon API. fileFolderConfig.folder should be no exception. It has to be for now, because folder objects can not yet be retrieved from the main API. But once this is done, it works and passing along sub-identifiers will then work as well. As I tried to point out, the difference is subtle, as relative paths and EXT: references are converted to PKG: syntax anyway. The difference is, that if an error occurs somewhere, the original resource identifier is preserved and supposed to be presented in the error message, which makes finding the mistake easier than when the system shows an identifier not supplied by the users. In the future, ideally there will be only one we to reference one resource, which means other ways will be deprecated one by one. For this very change here in it preliminary fashion, removing this line is fine for sure.
  17. Ayke Halder uploaded patch set 13 V +1 12/03/25, 09:10

  18. Ayke Halder commented on patch set 13 12/03/25, 09:11

    AbstractItemProvider.php:277 Reply

    Okay, the folder resource conversion is removed.
  19. core-ci voted on patch set 13 V +1 12/03/25, 09:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91509

  20. Helmut Hummel voted on patch set 13 CR +1 V +1 12/03/25, 11:38

  21. Christian Kuhn commented on patch set 13 12/09/25, 15:47

    tx_styleguide_elements_select select_single_7
  22. Christian Kuhn voted on patch set 13 CR +1 V +1 12/09/25, 15:52

  23. Helmut Hummel voted on patch set 13 CR +2 12/09/25, 17:25

  24. Helmut Hummel voted on patch set 13 V +2 12/09/25, 17:25

  25. Helmut Hummel merged patch set 14 12/09/25, 17:25