Buy Now
Sign in

Message and redirect

emmexx , May 15 2019, 12:36
E
emmexx 447
May 15 2019, 12:36 #386870
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 64
May 15 2019, 13:41 #386874
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
E
emmexx 447
May 15 2019, 14:03 #386877
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
admin 28
May 18 2019, 15:21 #386940
 Answer
Hi,
Yes, that's a bug, it should be fixed in the next update!
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!