Project

General

Profile

Actions

Bug #105262

closed

FlashMessageFinisher - configuration of severity in .form.yaml not possible

Added by Tobias Jungmann about 1 month ago. Updated 22 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2024-10-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #97787: Provide dedicated enum for severitiesClosed2022-06-17

Actions
Related to TYPO3 Core - Task #101043: Remove deprecated code in ContextualFeedbackSeverityClosedThomas Hohn2023-06-14

Actions
Actions

Also available in: Atom PDF