Review main Merged

90073[BUGFIX] Add option parameters for basic setting types

Benjamin Franzke CR +2 V +2 Hard +729 −55 updated 07/22/25, 07:12

Commit message

We’re adding missing extensibility to settings types, allowing for
validation, constraints, and other behavior. This includes validation
options for the following types:

- int: min, max, step
- number: min, max, step
- string: min, max

This brings them closer to parity with the constant editor, plus a
small improvement: Stepping is now supported, which wasn’t before.
We’ve limited this to int, number, and string to ensure consistency.

Example usage:

  settings:
    my_sitepackage.int_min_max_step:
      label: int_min_max_step
      category: my_sitepackage
      type: int
      default: 10
      options:
        min: 10
        max: 20
        step: 2

To support options and ensure validation, types now need to implement:
`SettingsTypeOptionAwareInterface`

This interface requires each type to provide its supported options,
which are validated during compile time. This ensures it has no effect
on existing custom types for the settings and as the optional the types
behave the same as before.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • Benjamin Kott +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • Benjamin Kott +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 26

Show 6 more files

Review log 3240

Show 1015 earlier messages
  1. Benjamin Franzke uploaded patch set 1 07/15/25, 09:33

  2. core-ci voted on patch set 1 V +1 07/15/25, 09:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81730

  3. Benjamin Kott uploaded patch set 2 V +1 07/15/25, 12:58

  4. core-ci voted on patch set 2 V +1 07/15/25, 13:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81737

  5. Lina Wolf commented on patch set 2 07/15/25, 14:22

    It would be good to have funcitonal tests where it is confirmed that the newly added validations are indeed working.
  6. Benjamin Franzke uploaded patch set 3 V +1 07/16/25, 06:53

  7. core-ci voted on patch set 3 V +1 07/16/25, 07:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81766

  8. Benjamin Franzke commented on patch set 3 CR -1 07/16/25, 09:56

    Reply

    ack, benji deleted that TODO from the commit msg – https://review.typo3.org/c/Packages/TYPO3.CMS/+/90073/1..2//COMMIT_MSG#b17 – by accident. I will take care of that.
  9. Benjamin Franzke uploaded patch set 4 CR -1 V +1 07/17/25, 06:49

  10. Benjamin Franzke commented on patch set 4 07/17/25, 06:49

    Reply

    Done
    (voting +1 since benji is the author, I just uploaded because I splitted this one from https://review.typo3.org/c/Packages/TYPO3.CMS/+/90034)
  11. core-ci voted on patch set 4 V +1 07/17/25, 06:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81806

  12. Garvin Hicking commented on patch set 4 07/17/25, 07:24

    SiteSettingsTest.php:50

    ```suggestion public function retrieveSettingsWithValidationOptions(): void ```

    SiteSettingsTest.php:78

    ```suggestion public function retrieveCorrectlyOverwrittenSettingsWithValidationOptions(): void ```
  13. Benjamin Franzke uploaded patch set 5 CR +1 V +1 07/17/25, 07:40

  14. Benjamin Franzke commented on patch set 5 07/17/25, 07:40

    SiteSettingsTest.php:50 Reply

    Done

    SiteSettingsTest.php:78 Reply

    Done
  15. core-ci voted on patch set 5 V +1 07/17/25, 07:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81811

  1. Garvin Hicking commented on patch set 5 V -1 07/17/25, 09:18

    - If a settings.definitions.yaml file contains bad validator options or missing defaults, the error messag ein the site overview overflows the box and is cut off, and illegible. See screenshot: https://www.dropbox.com/scl/fi/ml5rxbpsjj26mnzp61bk4/Screenshot-2025-07-17-at-10.57.12.png?rlkey=n0awx0k5nwgb8rcoftfvpy8z3&dl=0 - Having this in a settings.definitions.yaml ``` felogin.example.string.with.max.option: type: string label: 'String with max option' default: 'foo' options: max: 3 ``` and then entering "Yo" as the input, the settings manager says "Settings saved!" and I get no error message that something failed. The value is then reset to "foo". I would expect a notice saying which inputs were not persisted (or reverted to defaults)? - For number/int with a "min: 1" definition, I can remove a number input from the settings and save, get a success, but I would expect a notice like "invalid empty number specified, falling back to default".
  2. Benjamin Franzke uploaded patch set 6 CR +1 V +1 07/17/25, 09:38

  3. Benjamin Franzke commented on patch set 6 07/17/25, 09:38

    Reply

    you are right, backend reporting is missing, or better absent. We require that all validations are descriptive and can be handled in frontend (for immediate user feedback), therefore backend does only perform validation, no reporting. Idea is: The form should handle all invalid cases before submitting, backend validation is "only" for security. This *might* change, but current advantage is: Most backend reportings are ugly and broken, since they are tested seldomly, because frontend validates and reports upfront anyway, so it's better to only validate in backend. This might not always be feasable, but that's current "idea". Hope that makes sense. Now to the bug you found: During refactoring there has been made an error which causes `min` instead of `minlength` to be used for the string input type. This is fixed now. Thanks a lot!
  4. Benjamin Franzke uploaded patch set 7 CR +1 V +1 07/17/25, 09:42

  5. Benjamin Franzke voted on patch set 7 CR 0 V -1 07/17/25, 11:05

  6. Benjamin Franzke uploaded patch set 8 V -1 07/17/25, 12:13

  7. Benjamin Franzke voted on patch set 8 CR 0 V -1 07/17/25, 12:44

  8. Benjamin Franzke uploaded patch set 9 V -1 07/17/25, 13:49

  9. core-ci voted on patch set 9 V +1 07/17/25, 15:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81850

  10. Lina Wolf commented on patch set 9 CR +1 07/17/25, 15:15

    PHP Code looks good to me, I cannot tell with ts code
  11. Lina Wolf commented on patch set 9 V -1 07/17/25, 15:32

    Using an invalid combination of max and min values: ``` default: 1 options: min: 5 max: 1 ``` I get error message "Site set 'my-vendor/my-site-package' is disabled due to invalid settings definitions: Invalid default value in setting "MySitePackage.footerMenuRoot"" The actual issue is however that max is smaller then min.
  12. Lina Wolf commented on patch set 9 07/17/25, 15:36

    Reply

    If you set max:0 for the string you will get an input field where you cannot type anything and that does not display any error message
  13. Benjamin Franzke commented on patch set 9 V 0 CR -1 07/17/25, 15:58

    Reply

    ack, I think we need to be enable types to validate options (also useful for other future cases). will work on that
  14. Benjamin Franzke uploaded patch set 10 CR +1 V +1 07/18/25, 07:28

  15. Benjamin Franzke commented on patch set 10 07/18/25, 07:28

    Reply

    Fixed both cases to cause a setting definition invalidation.
  16. core-ci voted on patch set 10 V +1 07/18/25, 07:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/81905

  17. Benjamin Franzke commented on patch set 10 CR -1 07/21/25, 07:35

    on it
  18. Benjamin Franzke uploaded patch set 11 CR -1 V +1 07/21/25, 09:20

  19. Benjamin Franzke commented on patch set 11 07/21/25, 09:20

    Reply

    Done
  20. core-ci voted on patch set 11 V +1 07/21/25, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82038

  21. Garvin Hicking commented on patch set 11 CR +1 V +1 07/21/25, 15:23

    Great iteration, many thanks! :)
  22. Simon Schaufelberger voted on patch set 11 CR +1 V +1 07/21/25, 16:45

  23. Benjamin Kott voted on patch set 11 CR +1 V +1 07/22/25, 07:02

  24. Benjamin Franzke voted on patch set 11 CR +2 V +2 07/22/25, 07:02

  25. Benjamin Franzke merged patch set 12 07/22/25, 07:12