Forums

How do I return to a Joomla page after saving a CF form from a CC table?

bon-ja-mon 24 Mar, 2016
Hi

I have set up a Joomla article which has some instructional information and a CC connection (via the shortcode).

Using the New toolbar button it successfully loads the related CF form and I have set up the OnSubmit to have a Connection Action to the right CC connection. This part works fine too as I can see that the data has been saved to the db correctly.

What I am having trouble with is that after saving the data from the CF, I am returned to the CC connection and not the Joomla article I created with the CC embedded in it, which is where I need to be redirected to.

Help !!
GreyHead 25 Mar, 2016
Hi bon-ja-mon,

I think that you have to use a manual link to the edit form and then do the DB Save and Redirect in the form On Submit event.

I think that the problem with using the action is that the save is done by CC after the return from the form so you can't redirect from the form itself.

Bob
bon-ja-mon 25 Mar, 2016
Hi Bob

Can you give me some brief instructions on what I need to change?
On the CF I should remove the OnSubmit Connection Action and replace this with a DB Save and Redirect?
I have used Model IDs of "expenses" on this form, so on the DB Save should I say Yes to Save Under Model ID? And then put "expenses" without the the quotes in the Model ID box?
The reason I ask is when I tried that I got this error:
Fatal error: Cannot redeclare class GCore\Models\expenses in /var/sites/t/tempsite2.com/public_html/administrator/components/com_chronoforms5/chronoforms/actions/db_save/db_save.php(73) : eval()'d code on line 4

Thanks
GreyHead 25 Mar, 2016
Answer
Hi bon-ja-mon,

I've checked the code in the current release of CFv5 and - as far as I can see - it shouldn't allow the creation of a duplicate class :-(

Do you have another DB Save or read from the expenses table in the same form event?

Going sideways - do you need to have CC embedded in an article? Sometimes it's simpler to add the article text to the CC Header and/or footer boxes.

Bob
bon-ja-mon 25 Mar, 2016
Hi Bob

No other DB Save or DB Read from the expenses table in the same form event.

Good thought on using the CC Header and / or Footer instead of embedding the CC in to an article! The rest of the article was only HTML to give the user instructions so I can copy this to the CC Header and then use the CC instead of an article.

Cheers for the idea.
This topic is locked and no more replies can be posted.