[TYPO3-core] RFC #11684: Add support for flash messages in the backend
Michael Stucki
michael at typo3.org
Tue Aug 25 01:36:38 CEST 2009
Hi Xavier,
> As you may know, I started doing tests to create ExtJS backend modules.
> I do not rely anymore on any template, meaning I'll (and I guess *I*
> won't be the only one) need a way to show these messages without refresh
> of the whole page. A few extensions are now using ExtJS even without
> what I'm planning to do. See EXT:addresses for instance. How are Flash
> messages supposed to work for those modules? Or are Flash messages only
> meant for Core extensions? Will recycler be able to show those Flash
> messages?
Currently the messages are not used by any ExtJS based modules, but of
course that should be the long time goal.
After talking to Ingo and thinking about it more, I think that you are
right that this feature should find its way into 4.3 as well.
However, as the discussion grows together with the patch, I suggest to
commit the current code as is, and add the missing stuff later.
(Actually the patch has been approved on reviewing by Francois and Georg
already, and Francois and me have tested it for quite a while now...)
>> The solution to this is to introduce an error and exception handling
>> system that collects all errors and also uses flash messages to show
>> them in a non-disruptive way atop of the content, not pushing down
>> controls in the docheader. Str_replace again makes sure that the
>> errors are displayed at the right location and make sure that they're
>> definitly shown.
>
> You said earlier that you did not change the template as there might be
> cases were it was updated. Well, then why do you force those Flash
> messages to be shown before content? Perhaps I want to define my own
> template where messages are shown in a sidebar. It won't be possible if
> you str_replace() the content, by updating the template itself as Rupert
> suggested, you allow us to put it wherever it makes much sense.
I agree.
@Ingo: I suggest to use this workaround for that case:
if (strstr($moduleBody, '###FLASHMESSAGES###')) {
$moduleBody = str_replace(
'###FLASHMESSAGES###',
$flashMessages,
$moduleBody
);
} else {
$moduleBody = str_replace(
'###CONTENT###',
$flashMessages . '###CONTENT###',
$moduleBody
);
}
Does this fit your needs then?
>> Hope that clarifies why I chose str_replace(), it's mainly a way to
>> enforce displaying the messages and making sure to have them displayed
>> at the right place.
>
> It's mainly a way to ease the task of committing this patch but it
> certainly is not anything else than that. By modifying the template you
> allow anybody to put it where it makes sense in any situation and by
> modifying the main template (which I guess nobody ever change), you can
> ensure too that it is put before content.
The above change should will solve this problem, but besides this, I do
not agree about your comment.
Ingo has provided a patch which is fully working. Well, it may not work
with ExtJS modules at the moment, but that is just a small problem since
no ExtJS module is currently using it.
So in my opinion, there is no problem to split the patch into parts and
commit this first part right now and implement the missing stuff at a
later time (I'm thinking of an AJAX handler which can be triggered from
anywhere in the backend...)
This is not just a way to ease the task, it is also a motivating factor
to have the huge part solved for now. I would not accept this situation
if it leads to a broken or half-working result, but the situation here
is clearly that everything works as excepted as long as standard BE
modules are used.
> Last word, I agree with Rupert that 2 UPDATE that do nothing for each
> page/part refresh is certainly not optimal, even if it comes from FLOW3.
> FLOW3 is not yet really used and v5 does not exist. The real "base" is
> Extbase, not FLOW3 and Extbase, as it is being more and more used for
> "real" already made enhancements which were backported to FLOW3. Ideas
> are really great in FLOW3 but it does not mean all concepts are ready to
> be used as-this. This is no argument to rely on how FLOW3 does
> something. The concepts there are much more than what we will ever
> (hopefully) see in v4.
According to Ingo, this has been fixed in the latest patch
(changed_warningboxes.diff).
Regards, Michael
--
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
More information about the TYPO3-team-core
mailing list