[TYPO3-mvc] T3 6.2 ActionController: flashMessage after redirect issue

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Thu Aug 21 22:22:57 CEST 2014


On 08/21/2014 02:14 PM, Helmut Hummel wrote:
> Hi Till!
>
> On 21.08.14 03:57, g4-lisz at tonarchiv.ch wrote:
>
>> there is some issue in a extension we try to migrate from 4.6 to 6.2:
>>
>> In the controller class there is an editAction, which displays an
>> edit form.
>> There is also an updateAction, which is called when the form has been
>> submittet.
>>
>> After processing form data, the updateAction redirects to editAction
>> again.
>> Before doing so, it adds a message using
>>      $this->addFlashMessage('Saved');
>>
>> This message is not shown anymore. This was working with T3. 4.6.
>
> Nothing relevant changed in this area.
>
>> What I am doing wrong? How can I add a flash message in an update
>> action?
>
> Please be aware that if your controller uses the default flash message
> queue (which is the default ^^) then all other plugins that render
> flash messages will empty this queue (after rendering).
>
> This means if you have another plugin on the same page (e.g. News),
> the flash message will be added, a redirect header will be set, but
> the rendering continues which means another plugin (e.g. News) will be
> rendered, but the user will never see the result as after the
> rendering the redirect happens (because of the redirect HTTP header).
>
> This is how flash messages are misteriously lost...
>
> If you want dedicated queues for each plugin set the following TS:
>
> config.tx_extbase.legacy.enableLegacyFlashMessageHandling = 0
>
> Kind regards,
> Helmut
>
You made my day!

Indeed it was another plugin which "consumed" the messages in queue. I
wonder why it worked with 4.6.

The other plugin's output was hidden by some accordion trickery ;)

Thank you very much for the configuration hint.

Cheers,
Till



More information about the TYPO3-project-typo3v4mvc mailing list