Forums

Cannot save using the plug-in

batida 05 Sep, 2014
Hi!

I made a form using Chronoform5. On submit it saves the form data to the database, and sends an email to me. When I tested it from the administration page, the email was sent, and the database insert was also made successfully. Then I wrote an article, and embedded the form there with the plug-in, with the {chronoforms5}...{/chronoforms5} tags. When I submit the form embedded in the article, it sends the email perfectly, but nothing apears in the database. Has anyone any suggession?
GreyHead 05 Sep, 2014
Answer
1 Likes
Hi batida,

We've seen this before I think; the problem is cause by the &id=xxx in the article page URL. ChronoForms sees this and then the DB Save action tries to update the record with id=xxx which probably doesn't exist.

The best solution IMHO is to rename the primary key column in the database table from id to say, cf_id. it's an easy change in PHPMyAdmin. This should remove the problem. If there is some reason that you can't do that - for example, if the table is used by Joomla! or by other component then we can give you another fix.

Bob
batida 07 Sep, 2014
Thank you, it work🙂
applebox 13 May, 2015
Bob, I'm having this exact same issue. Works under testing the form but does not work with the plugin.
I have the very latest version of CF5. I've tried deleting the tables and creating new ones and starting from scratch and it just won't save to DB. I'm using SEF URLs. Might that have something to do with it? Never had this issue before with CF4.
Thanks,
Mike
applebox 13 May, 2015
I threw a debugger on there and tested the form out of the component and on the site via the live plugin.
The component is inputting all of the data in the DB. However, notice that the plugin version is only trying to save data to three fields (user_id, uniq_id and created).
Might this be an issue with the SQL associated with the plugin?
GreyHead 14 May, 2015
Hi MIke,

I don't see any obvious reason why the plug-in version MySQL only contains those three values - they are the ones that CF creates so it is as if the $form->data[''] values aren't available to the DB Save action.

There is an evident problem with the ID and there is a difference with the uniq_id, which is only in the Plug-in version - how is that created?

Bob
applebox 14 May, 2015
Very strange. I decided to try and test whether it had something to do with SEF URLs and created a link using the menu component link. That test out just fine. I went back to the page I had set up with the plugin, tested it and it worked just fine.
Now I'm baffled. I guess for now, I'll let it go and let you know if I have any other issues.
Thanks Bob.
MIke
applebox 14 May, 2015
I know this is a shot in the dark, but you don't suppose that creating a link to that form using the component menu link fixed something do you? That would be a really weird bug. But I was having issues with 3 other forms doing the same thing using the plugin. When I created a menu item (hidden from the website) that pointed to the same form using the component menu link, they are now all working with saving the info into the database.
I just want to know moving forward because I like using ChronoForms and this is the first time I've had this particular issue.
Thanks,
Mike
GreyHead 14 May, 2015
Hi Mike,

I think it quite likely that adding the Menu is helping. I've done that myself recently to get clean URLs for a form. What I don't understand is why that is. It looks to me as if something I've no idea what - has changed in the way Joomla! 3 is handling URLs, I am seeing many more URL problems in the last few months :-(

Bob
applebox 14 May, 2015
Well, not to add to the mystery, but this particular site was originally built a few years ago on Joomla 2.5. So even that could be an issue. I use CF5 with Joomla 3 on other sites with no problems. This site started out with CF4 forms but the newer forms needed some of the better layout features in CF5 so that's why I went in that direction. But then I had ReCaptcha issues that I didn't have the CF4. No matter what code I put in, it said it was wrong. ReCaptcha on CF4 Forms was working great. These are some weird bugs. Anyway, I went with CF5 forms using the built-in captcha and now it's all working (for now at least).

Also, I'm not sure if you caught what I did or not. I'm not using the component menu links for the forms that are active on the site, I'm still using the plugin version embedded in the article. But they would only work after I pointed a menu link to the same form. I have a menu created that's not visible on the site - mainly to use as alias links. I put them there. It's almost like doing that activated something in the plugin. I know that's probably not possible, but I just know that, before I did that - none of the forms saved to the DB. After I did that, they all did. Bizarre!

Thanks for your quick responses as always. I'm sure it's quite the headache trying to figure out why things work on some site but not others. You guys do a great job with support though.

Cheers!
GreyHead 15 May, 2015
Hi Mike,

Thank you - that more or less what I had understood. I think that the Joomla! router code checks the menu items somewhere along the line and seems to use that URL if it is found. More investigation when I have time.

Bob
applebox 15 May, 2015
It's all good. I guess we are all here to make these extensions the best they can be🙂
This topic is locked and no more replies can be posted.