Forums

Message and redirect

emmexx 15 May, 2019
I'm pretty sure that messages are displayed after a redirect in CCV6, for example in an event:
{success:Saved!}
{redirect:index}
At the moment I don't remember one of my projects in CFv6 that uses the message and redirect actions to get the same result but I'm sure there's one.
Now in a new project in Joomla 3.9.5 and CF v6.1.2 if I use a message followed by a redirect, no message is displayed.
I tried to accomplish that by using enqueueMessage in a php action followed by a redirect action to no avail.
I had to resort to an all php code action to get a joomla message displayed after the redirect:
$app = JFactory::getApplication();
$app->enqueueMessage('Not saved', 'error');
$app->redirect('index.php?option=com_chronoforms6&cont=manager&chronoform=myform&event=myevent');
maxx
GreyHead 15 May, 2019
Hi maxx,

Generally to show a message after a Redirect you need to use a System Message. After the redirect ChronoForms has lost control and so can't display a CF message.

Bob
emmexx 15 May, 2019

Generally to show a message after a Redirect you need to use a System Message. After the redirect ChronoForms has lost control and so can't display a CF message.


But why does it work in CC? And why doesn't it in CF since the code seems to be the same?

In message.message_output.php:
\GApp::session()->flash($type, $content);
In parser.php:
\GApp::session()->flash($type, $this->lang($name));

In one of the demo of CC, Articles list with advanced features, there's a publish_selected event:
{fn:publish_articles_group}
{success:articles publsihed}
{redirect:index}
I used a similar code many times and it works. I'm sure I can find one of my CFV6 apps that uses the CFv6 actions instead and it works too.

maxx
Max_admin 18 May, 2019
Answer
Hi,

Yes, that's a bug, it should be fixed in the next update!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount

{item:title} {images:#}