Review main Merged

91307[BUGFIX] Detect `FIRST_INSTALL` in project path as well

morgane garcia CR +2 V +2 Normal +223 −8 updated 11/10/25, 19:26

Commit message

In the past, a system administrator who set up TYPO3 had
to create a FIRST_INSTALL in the public path ("htdocs")
to gain access to the installer.

Since the introduction of the composer mode, it is possible
to have the public path in a subfolder as well.

However, people still needed to create the `FIRST_INSTALL`
file in the public path, whereas the project root path is
much more useful and convenient for newcomers.

This patch now:

* Checks for `FIRST_INSTALL` in both project root and
  public path, instead of only the public directory.

* Modified getFirstInstallFilePaths() to scan both paths
  and return the detected files with the absolute path.

* Updates `removeFirstInstallFile()` to delete found
  files using the now returned absolute path and not
  adding a prefix path anymore.

* Adds functional tests for new behavior.

Review

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

Issues 1

Files 2

Review log 2534

Show 69 earlier messages
  1. morgane garcia uploaded patch set 1 10/28/25, 11:57

  2. morgane garcia updated the commit message in patch set 2 10/28/25, 12:00

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

  4. core-ci voted on patch set 2 V +1 10/28/25, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87813

  5. Stefan Bürk commented on patch set 2 10/28/25, 20:59

    EnableFileService.php:239

    Aren't the "paths" relative to the scanned folder ? Maybe we could work with absolute paths returned, would also avoid the additional heck in the remove method. We could also have a look into the install tool enabled path handling and adopt it for the fist install in the same way ...
  6. Stefan Bürk commented on patch set 2 10/28/25, 21:00

    EnableFileService.php:239 Reply

    Forget it ... install tool enabled does not do the scandir approach to mitigate casing issues I guess ....
  7. morgane garcia rebased onto patch set 3 V +1 10/29/25, 08:15

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

  9. Benni Mack updated the commit message in patch set 4 V +1 10/29/25, 09:06

  1. Benni Mack commented on patch set 4 10/29/25, 09:06

    EnableFileService.php:239 Reply

    Is your comment still applicable? Or can it be resolved?
  2. core-ci voted on patch set 4 V +1 10/29/25, 09:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87918

  3. Stefan Bürk commented on patch set 4 10/30/25, 11:40

    EnableFileService.php:239 Reply

    Sorry for the confusion, I'll try now to resolve the confusion. I'd say that in general we should revisit the implementation for the `FIRST_INSTALL` in general and adopt more the granular and install mode depending approach used for the `ENABLE_INSTALL_TOOL` location handling. But that would be out of scope for a bugfix now. The current try to fix this is not really clean in my eyes, so please correct me if I'm wrong. * `getFirstInstallFilePaths()` was ment to return only file basename variants of `FIRST_INSTALL` to mitigate casing issues, expected under the public path. * Method `removeFirstInstallFile()` prefixes the filename with the public path (again) to the result of `getFirstInstallFilePaths()` * `isFirstInstallAllowed()` only checks if there is a "result" because it's clear that the files exists returned by `getFirstInstallFilePaths()` * This change modifies `getFirstInstallFilePaths()` to mix findins of different paths but only return the filename without path. For example, if a `./FIRST_INSTALL` is set in the project root and a `public/first_install` exists it would return `['FIRST_INSTALL', 'first_install']` and it needs to be done/checked again in the `removeFirstInstallFile()` which base folder contains that entry to delete them all. Introducing additional is_file calls etc. What I would suggest as a doable modification: * Keep the scannig of the two different folders for the file in `getFirstInstallFilePaths()` but ensure that the absolute path is returned in the array. * `removeFirstInstallFile()` should be modified based on the current main state to not prefix with the public path anymore and take the result as a absolute paths. I hope that make's it clear what needs to be adjusted from my point of view. Otherwise I can push it later what I mean. Or am I'm wrong here ?
  4. Stefan Bürk uploaded patch set 5 V +1 10/31/25, 13:28

  5. Stefan Bürk commented on patch set 5 10/31/25, 13:31

    EnableFileService.php:239 Reply

    Pushed the changes based on my suggestion already. However, tests needs to be modified to make them executed tests. Resolving this comment now as solved.

    EnableFileServiceTest.php:82

    These tests are never executed, functional tests are non-composer instances by design and currently they are use-less. Need to have a look into that how to make them use-full and testing that, needs more work.
  6. core-ci voted on patch set 5 V +1 10/31/25, 13:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88259

  7. Christian Hernmarck commented on patch set 5 10/31/25, 14:06

    Hi guys I wonder why I receive updates to this issue. It seems its this line in the description "Resolves: (#) 91307" but I don't see any connection to Bug No 91307 .... Am I wrong? Sorry fo writing here....
  8. Stefan Bürk commented on patch set 5 10/31/25, 14:12

    Reply

    Because you are a `CC` reciepent. Not sure who added you there, but you can simply remove yourself from it.
  9. Stefan Bürk commented on patch set 5 10/31/25, 14:13

    Reply

    At least for gerrit mails. Forge mails are because patchsets adds comments to the forge issue and you may recieve ticket update mails from forge depending on your notification settings there.
  10. Stefan Bürk commented on patch set 5 10/31/25, 14:15

    Reply

    Sorry, I must correct myself. You are right, that is the wrong forge issue number , going to update it with the correct one once I found it. Sorry for the noice.
  11. Stefan Bürk updated the commit message in patch set 6 V +1 10/31/25, 14:18

  12. core-ci voted on patch set 6 V +1 10/31/25, 14:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88263

  13. Stefan Bürk uploaded patch set 7 V +1 11/10/25, 09:46

  14. core-ci voted on patch set 7 V +1 11/10/25, 09:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88812

  15. Stefan Bürk updated the commit message in patch set 8 V +1 11/10/25, 10:17

  16. Stefan Bürk commented on patch set 8 11/10/25, 10:18

    EnableFileServiceTest.php:82 Reply

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

  18. Stefan Bürk voted on patch set 8 CR +1 V +1 11/10/25, 10:41

  19. Garvin Hicking commented on patch set 8 11/10/25, 11:49

    EnableFileServiceTest.php:67

    shouldn't this be $projectPath? $publicPath is already rmdir'd in line 53
  20. Stefan Bürk commented on patch set 9 CR +1 V +1 11/10/25, 12:03

    Published edit on patch set 8.
  21. Stefan Bürk commented on patch set 9 11/10/25, 12:04

    EnableFileServiceTest.php:67 Reply

    Good catch. Done.
  22. core-ci voted on patch set 9 V +1 11/10/25, 12:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88837

  23. Garvin Hicking voted on patch set 9 CR +1 V +1 11/10/25, 13:27

  24. Stefan Bürk voted on patch set 9 CR +2 V +2 11/10/25, 19:16

  25. Stefan Bürk merged patch set 10 11/10/25, 19:26