Review main Merged

86547[BUGFIX] Handle `severity` configuration in `FlashMessage` finisher properly

Andreas Kienast CR +2 V +2 Easy +17 −13 updated 10/25/24, 09:32

Commit message

The definition of the `FlashMessage` form finisher accepts the option
`severity` to be set. With the introduction of
`ContextualFeedbackSeverity`, migration was not properly handled as Yaml
can only take literal values.

From a technical point of view it's possible to use the `!php/enum` flag
in the Yaml configuration, which forces us to enable constant parsing
via `Yaml::PARSE_CONSTANT`, opening another can of worms which we want
to avoid here at any cost.

This patch reverts the deprecation of the integer-based severity to
allow configuring the severity via Yaml again.

Review

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

Issues 3

Files 2

Review log 2736

Show 811 earlier messages
  1. Andreas Kienast uploaded patch set 1 10/10/24, 10:32

  2. Andreas Kienast commented on patch set 1 10/10/24, 10:37

    FlashMessageFinisher.php:101 Unresolved

    Note for v12 backport: this needs to be merged with the existing `is_int()` deprecation.
  3. core-ci voted on patch set 1 V +1 10/10/24, 10:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67494

  4. Andreas Kienast uploaded patch set 2 V +1 10/10/24, 10:39

  5. core-ci voted on patch set 2 V +1 10/10/24, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67495

  6. Tobias Jungmann commented on patch set 2 CR +1 V +1 10/10/24, 10:59

  7. Benjamin Franzke commented on patch set 2 10/10/24, 11:14

    FlashMessageFinisher.php:99

    We should we introduce constant-evaluation if we didn't had that in v11? Can't we use `ContextualFeedbackSeverity::from()` and therefore support the same syntax as in v11 – or do I get it totally wrong? I'd actually revert the `is_int` deprecation… It would only make sense to define concrete string values – I'm against exposing PHP constants in yaml configuration.
  8. Andreas Kienast commented on patch set 2 10/10/24, 11:18

    FlashMessageFinisher.php:99 Reply

    I'm confused, v11 didn't have `ContextualFeedbackSeverity` at all. We could indeed use `tryFrom()` as well, at the cost of having one separate spot that allows integer values again, opposed to the rest of the Core.
  9. Andreas Kienast uploaded patch set 3 CR +1 V +1 10/11/24, 08:31

  10. Andreas Kienast commented on patch set 3 10/11/24, 08:38

    FlashMessageFinisher.php:99 Reply

    Done
  11. core-ci voted on patch set 3 V +1 10/11/24, 08:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67561

  1. Benjamin Franzke commented on patch set 3 CR +1 10/11/24, 08:45

    Reply

    changed to be just the keyword, but done

    FlashMessageFinisher.php:99 Reply

    Done
  2. Andreas Kienast uploaded patch set 4 CR +1 V +1 10/11/24, 11:47

  3. Andreas Kienast commented on patch set 4 CR -1 10/11/24, 11:47

    FlashMessageFinisher.php:99 Unresolved

    Not sure anymore if this is a great idea or whether we should revert the deprecation here and allow integer values again.
  4. core-ci voted on patch set 4 V -1 10/11/24, 11:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67588

  5. Andreas Kienast uploaded patch set 5 CR -1 V -1 10/11/24, 12:09

  6. Andreas Kienast uploaded patch set 6 10/11/24, 12:10

  7. Andreas Kienast uploaded patch set 7 10/11/24, 12:10

  8. core-ci voted on patch set 7 V -1 10/11/24, 12:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67593

  9. Tobias Jungmann commented on patch set 7 10/11/24, 12:24

    FlashMessageFinisher.php:102

    Maybe it would be more reasonable to throw an exception here instead of using the default value. If the severity is not an instance of ContextualFeedbackSeverity, the configuration is falsy and the developer should see that.
  10. Andreas Kienast commented on patch set 7 10/11/24, 12:43

    FlashMessageFinisher.php:102 Reply

    This would introduce a new breaking change. Previously, the code always fell back to the default severity.
  11. core-ci voted on patch set 7 V +1 10/11/24, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67593

  12. Andreas Kienast uploaded patch set 8 V +1 10/11/24, 12:49

  13. core-ci voted on patch set 8 V +1 10/11/24, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67597

  14. Tobias Jungmann commented on patch set 8 CR +1 10/11/24, 13:22

    FlashMessageFinisher.php:102 Reply

    Acknowledged
  15. Tobias Jungmann voted on patch set 8 V +1 10/11/24, 13:25

  16. Oliver Hader updated the commit message in patch set 9 CR +1 V +1 10/18/24, 13:58

  17. core-ci voted on patch set 9 V +1 10/18/24, 19:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68093

  18. Tobias Jungmann commented on patch set 9 10/19/24, 06:22

    FlashMessageFinisher.php:102

    The default option is already defined. Use `$severity = $this->defaultOptions['severity']`.
  19. Andreas Kienast commented on patch set 9 10/23/24, 09:07

    FlashMessageFinisher.php:102 Reply

    Acknowledged
  20. Andreas Kienast uploaded patch set 10 V +1 10/23/24, 09:07

  21. core-ci voted on patch set 10 V +1 10/23/24, 09:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68433

  22. Tobias Jungmann voted on patch set 10 CR +1 V +1 10/23/24, 10:15

  23. Garvin Hicking voted on patch set 10 CR +1 V +1 10/25/24, 08:23

  24. Andreas Kienast voted on patch set 10 CR +2 V +2 10/25/24, 09:23

  25. Andreas Kienast merged patch set 11 10/25/24, 09:32