Solved Form Success Message Default not overridden

pastvne

Bruce Decker
I have a form where I have set the success message to a value, and suppress = no. The default "Record added/updated" is still showing when saving a record. I'd actually prefer to set the success message from a Form Plugin in PHP based. I'm using Ganty Hydrogen. Questions:
1) What feature rich template is currently recommended. I like Gantry, are there any good ones I should consider?
2) Is this problem potentially template related? I think 'no' if I'm getting the default message instead of no success message.
 
I have set the success message to a value
Which one?
I can't replicate, my custom success message is showing.
I'd actually prefer to set the success message from a Form Plugin in PHP based.
How?

Template related: I don't think so. Did you try in the backend?

Gantry: AFAIK it should be ok, do you have any issues?
 
Last edited:
Interesting. I re-tested tonight and, the status message was correct. Then, I edited the form definition and changed the status message. The form continued to show the unedited status message. Then, I logged out, and back in, and the success message was now correct. This feels like a caching issue, but not critical. I still would like to be able to set the status message programmatically from a form plugin. Do you know if that is possible? I don't see it in documentation.

Regarding being able to set the success message in a PHP plugin, I think I have a hack that will work. In the form, I can have a 'not visible' element whose value I can set to my desired message "Subscription has been approved and the user has been notified via email".

Then in the success message field, I can just put a placeholder for that element {table_messagetext}. I tested, and it does indeed seem that the success message text of the form can include {placeholders} that will be expanded. If I get a slick example, where it won't be visible in the form, but will just serve as a place to set messages, I'll post the tip to the wiki.
 
Last edited:
Custom success message:
You can add a system message in your php plugin (will show in addition to the form's success message)
Code:
$app = Joomla\CMS\Factory::getApplication();
$app->enqueueMessage($message,'notice');
or you can use a redirect plugin to set a custom success message.
 
Custom success message:
You can add a system message in your php plugin (will show in addition to the form's success message)
Code:
$app = Joomla\CMS\Factory::getApplication();
$app->enqueueMessage($message,'notice');
or you can use a redirect plugin to set a custom success message.
That did the trick. Thanks again Troester. I'll add a tip to the wiki! You're the best. While I thought I was reporting a bug, it is not, so if you wish to move this into another channel, feel free.
 
I didn't know that the 1st enqueMessage($msg,'message')
will override the form's success message:cool:
 
I didn't know that the 1st enqueMessage($msg,'message')
will override the form's success message:cool:
Well then, I get to scratch one off my bucket list which is "Just once, contribute something of value to my relationship with Troester!" :) As always, I sincerely appreciate all of your help.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top