[TYPO3-core] RFC #11684: Add support for flash messages in the backend

Rupert Germann rupi at gmx.li
Sun Aug 23 23:58:39 CEST 2009


answer part 2

Ingo Renner schrieb:
...
>>> Especially these two are supposed to be replaced by flash messages.
>>
>> the latter one is not possible currently, because alt_intro doesn't use
>> template.php
> 
> Ah, so let me proof you wrong ;)
> See the attached patch, it replaces the old and ugly warning boxes with 
> flash messages, even for case 3. - don't forget about the render() 
> method of the flash messages ;)

ok, got me ;-)

> The attached patch also fixes the unnecessary UPDATE queries. 

works,
but I want my yellow boxes back!
the current rosé background is pretty gay ;-)
a soft red is nothing that I associate with a fatal error.

That would
> the be part of the commit. The rest would be a separate RFC (actually 
> replacing the warning boxes with flash messages).

not so fast.

....
>>> So, could you explain what you did to make the messages show up in
>>> both frames?
>>
>> I read the code ;-)
>> and the code says that the same function is called with the same input
>> in 2 different frames. That makes me sure that both frames will show the
>> same message-content. No need to test.
> 
> Due to the short living nature of the messages and the way they work 
> it's ensentially not possible to make the same messages (== same 
> objects) show up in both frames at the same time. I tried hard
> refreshing both frames at the same time, but failed due to being not 
> able to be faster than MySQL.

don't blame mysql.

SCNR: "my analysis is perfectly right the way it is. Don't try to bend 
your brain in a way that you shouldn't." ;-)

> Please show me a working scenario where messages show up in both frames, 
> to me it's (technically) not possible. Now it's your turn to proof me 
> wrong. ;)

no problem: I inserted a call to $this->doc->pushFlashMessage() in 
db_list.php and in alt_db_navframe.php. each call pushes one message in 
the be_user session.

according to you the result would be one message in navfrane and one in 
list frame. And this is actually right - for the first click (mostly).
But I'm the bad guy who clicks a second time and also on the other 
buttons ;-)

please confirm if you can repeat this behaviours (when calling 
pushFlashMessage() from both frames):

clear browser cache, reload the backend, click web->list (no page 
selected in the tree)
my backend shows a navframe with the expected message and an empty dummy 
frame with the navframe message and also the message from db_list.

then click on a page in the tree (still 3 messages) and reload the tree.
the message above the tree is gone. reload the list view and the tree 
severel times and you'll see sometimes more messages sometimes less.


>>> It could make sense though to display messages that are directly
>>> related to the tree only. I can't think of a scenario for that though.
>>
>> even if there would be a scenario it would not work to get different
>> output per frame because currently all messages are stored in the same
>> be_session field.
> 
> As Francois already pointed out already that might be solved with 
> "typing" of messages. As agreed with him I'd put that in a separate RFC, 
> too as it would require more complex testing.

even if it requires complex testing, it's a no go to commit half working 
stuff to the core. there must be either a way to distinguish messages to 
decide in which module they should be rendered or the display of 
messages must be restricted to the list module only.

another thing:
Francois changed the visibility of method pushFlashMessage() to public 
to allow calls to template::renderFlashMessages()
this doesn't work because in the first line of the method 
$this->getFlashMessagesFromSession() is called - and $this is obviously 
not present when the method is called statically.

but as Xavier pointed out we'll need other ways to push/display these 
messages which are not based on template.php

greets
rupert


More information about the TYPO3-team-core mailing list