Bug #105262
closedFlashMessageFinisher - configuration of severity in .form.yaml not possible
100%
Description
It's not possible to configure the severity for the FlashMessageFinisher in the .form.yaml file because the severity must be of type 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity' in the FlashMessage constructor but this cannot be achieved in the .form.yaml configuration.
Also the documentations https://docs.typo3.org/c/typo3/cms-form/main/en-us/I/Config/proto/finishersDefinition/finishers/FlashMessage.html#prototypes.prototypeIdentifier.finishersdefinition.flashmessage.options.severity and https://docs.typo3.org/c/typo3/cms-form/main/en-us/D/FinisherOptions/Index.html#apireference-finisheroptions-flashmessagefinisher are misleading as they claim, that the data type can be an integer.
The solution in v12 was this (see https://github.com/TYPO3-CMS/form/blob/12.4/Classes/Domain/Finishers/FlashMessageFinisher.php)
...
$severity = $this->parseOption('severity')
if (is_int($severity)) {
// @deprecated int type for $severity deprecated in v12, will change to Severity only in v13.
$severity = ContextualFeedbackSeverity::transform($severity);
}
...
This has been removed with v13 but it's necessary when using the yaml configuration.