Review 13.4 Merged

93427[BUGFIX] Properly evaluate '--create-site' in CLI SetupCommand

Garvin Hicking CR +2 V +2 Easy +13 −7 updated 03/30/26, 10:59

Commit message

Supplying the option `--create-site` to this command:

```
vendor/bin/typo3 setup --server-type=other --driver=mysqli \
  --host=db --port=3306 --dbname=db --username=db --password=db \
  --create-site
```

possibly returned `false` previously as the defined input option
default value, but now may return `null`, which is not part of
the method's `getFallbackValueEnvOrOption` return value and will
throw a PHP TypeError.

The important thing is: The command attribute itself requires
a value, so it made no sense to just add it as an argument
without a value.

This patch now:

* requires a value for the `--create-site` option

* modifies the question helper callback used in `getSiteSetup()` for
  interactive mode and non-interactive mode to take an empty
  string as invalid value and throw an exception

* hardens the `getFallbackValueEnvOrOption()` method by making
  the code path more clear and ensure to now return
  only a string or false to respect the defined method return
  type declaration. The method comment is adjusted to reflect this.

Review

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

Issues 1

Files 1

Review log 34

  1. Garvin Hicking commented on patch set 1 03/30/26, 10:46

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 03/30/26, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99040

  3. Garvin Hicking voted on patch set 1 CR +2 V +2 03/30/26, 10:59

  4. Garvin Hicking merged patch set 2 03/30/26, 10:59