Breaking: #97787 - AbstractMessage->getSeverity() returns ContextualFeedbackSeverity
See forge#97787
Description
The class \TYPO3\
and the extended
class \TYPO3\
both have a method
get
to return a flash message's severity. The return type of
the method is changed to return an instance of \TYPO3\
.
As this method isn't supposed to be used publicly, it is declared internal
now.
Impact
Relying on the return type of \TYPO3\
being int
will throw a Type
exception.
There is no negative impact in the following cases:
- Using the severity enum in Fluid for direct rendering
- Using the severity enum in
json_
encode ()
In these cases, the enum's value is automatically used.
Affected installations
All extensions using \TYPO3\
in PHP are affected, if the integer type is expected.
Migration
If the integer type of \TYPO3\
is expected, use the value
property of the Contextual
enum:
$flashMessage = new \TYPO3\CMS\Core\Messaging\FlashMessage('This is a message');
$severityAsInt = $flashMessage->getSeverity()->value;
The same applies to Fluid template, where the severity is used within another structure, e.g. as an array key:
<div class="x" class="{severityClassMapping.{status.severity.value}}">
<!-- stuff happens here -->
</div>