Parisi
Member
I am running a very simple PHP form plugin on EndofFormSubmission. I use this plugin to take the ID of any tags that I have entered in a "tags" element and then echo out that information in the Joomla message area after clicking "save" on the form. The expected result is that the ID of any tags I have entered is echoed out in the message.
This works in all instances except if the tag I entered has not yet been created in the J tags table. In that case, the "message" on the next page echoes out "#fabrik#[newtag]" instead of an ID.
I suspect that the Fabrik Tag plugin runs its script to create any new tags after the "EndofFormSubmission", so that I am getting filler text instead of the newly created tag ID.
Is there any way I can run my script after the Fabrik Tag plugin creates a new tag?
Here is the code I am running:
This works in all instances except if the tag I entered has not yet been created in the J tags table. In that case, the "message" on the next page echoes out "#fabrik#[newtag]" instead of an ID.
I suspect that the Fabrik Tag plugin runs its script to create any new tags after the "EndofFormSubmission", so that I am getting filler text instead of the newly created tag ID.
Is there any way I can run my script after the Fabrik Tag plugin creates a new tag?
Here is the code I am running:
Code:
// instantiate Joomla app
$app = JFactory::getApplication();
// get the array of information from the tag element
$add_tags = $formModel->getElementData('tag_form___add_tags');
// implode array of tag IDs into text
$add = implode(',',$add_tags);
// URL to navigate to after "save", currently home page
$your_url = "/";
// the imploded IDs
$your_msg = $add;
$app->redirect( JRoute::_($your_url), $your_msg);