[TYPO3-core] RFC #12130: Improve performance of flashmessages

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Oct 7 11:35:25 CEST 2009


Rupert Germann schrieb:

>> So assuming that we need these flash messages (at least some) to survive
>> one request and assuming PHP session might not be initialized, I still
>> think it would be best to:
> 
> ok ernesto, you convinced me. $_SESSION can fail.
> 
> So let's go back to storing the messageQueue in an object.
> This - as already mentioned - will not survive a redirect and it's not
> possible to show messages from one process (eg. an ajax call) in another
> independent process (eg. the list module).
> 
> But I currently don't see where this could be needed. Can someone give
> me an example where this could happen?
> How would such an ajax flashmessage be displayed? where?

I don't know how it is used on ajax, but I have used this kind of
processing for ages: Every "POST" processing should redirect to a new
page (GET) to avoid posting the same stuff twice [1].

This can be helpful for example when hitting a "delete" button, when
submitting "form" data, or other situations where you want the action
only to happen once.

But after the redirect, you might still want to display the message
"Record deleted" or "Record updated" or even a list of errors while
deleting / saving. This is where you need to carry the flash message
from one hit (POST) to the next one (redirected GET).

Cheers,
Ernesto

[1] http://en.wikipedia.org/wiki/Post/Redirect/Get


More information about the TYPO3-team-core mailing list