Forums

Two Problems Stemming From Magic Quotes

applebox 25 Jun, 2014
I have two very big problems. I was posting some custom JavaScript in the On Load section of the Setup, but it was putting escape "\" characters before the quotes. I saw on another post that this was due to Magic Quotes being turned on. So I found out how to turn them off and then tried to re-post the JavaScript and when I did that, the whole On Load and On Submit events were totally blank. Plus I was getting the following error: Warning: Invalid argument supplied for foreach() in /administrator/components/com_chronoforms5/chronoforms/views/index.php on line 55. Now, when I try to put any element in those Action sections, it doesn't take. I even tried to Restore the whole site back from where it was yesterday (from the CPanel) and it's still doing it. I archived the form and then tried to restore it and no good. If I create a new form, then I can get it to work. I had a lot of custom things going on that I can't get back now. Is this data that is stored somewhere else where the Restoring of the site or the Backup file would have no affect on trying to bring it back? Is there a way to save it or do I need to start from square 1 again?

Bigger question, once I do get it back up and running, what do I do about the Magic Quotes problem? Turning them off screws everything up, and leaving them on screws up my JavaScript code and it won't run. Do I need to add the JavaScript somewhere else or load a JS file instead of pasting code? Please help as soon as you can. This site was supposed to be launched yesterday and this is the only thing holding it up.

Thanks,
Mike
applebox 26 Jun, 2014
I'm not sure if this will help or not, but when I take out a second set of radio buttons and a Text field then the error goes away. This doesn't help the Magic Quotes issue, but I'm not sure how to get around this part. I've tried even uninstalling and reinstalling ChronoForms and nothing has changed.
applebox 26 Jun, 2014
Well, I had to switch to V4 - what a pain. Cost me a whole day of work. And now the PayPal Redirect is wonky.
The amount in the field is correct, but when it sends it to PayPal, the cost added $400! If the field says $100, it shows up in PayPal as $500 (and so on). Can anyone help with this?
GreyHead 27 Jun, 2014
Hi Mike,

It sounds as though you have the Trial version of the PayPal ReDirect action which randomises the amounts. If you already have a paid version for CFv5 then please contact Max to get the patch files for CFv4.

Magic Quotes need to be Off for CFv5 to run correctly. The setting is deprecated in PHP 5.3 and removed in 5.4; Joomla! also recommends that they are off for 2.5 and requires them off for Joomla! 3. Please see this Joomla! doc.

I have no idea why turning Magic Quotes off would affect the saved forms - I guess that maybe there were saved /// somewhere that caused problems.

Bob
applebox 27 Jun, 2014
Bob, thanks for the quick reply. Got the forms all re-built in CFv4 (was a bit of a pain). No issues with Magic Quotes so far. Not sure why turning them off killed the form either, but it all went downhill from there. So I'll probably deal with the CFv5 issues on another site.

So far, all is well with v4. What you said about the PayPal plugin makes sense. However, I purchased the plugin today and validated it on the site. Is there supposed to be a PayPal Redirect (non trial) action in the left menu? I don't see one. Or does the validation just change the status? I'm asking because the amount is still not correct.

In a related side note, why is ReCaptcha not available with the latest version of CFv4 (there is a Captcha input, but no ReCaptcha like before, but there are Load ReCaptcha and Check ReCecaptcha elements in the Actions)?
Is there a patch to fix that and maybe is that the reason the PayPal Redirect (paid version) is not showing up?
I'm attaching some pics.
GreyHead 28 Jun, 2014
Hi Mike,

I don't know exactly how Max handles the action upgrades. I think that he emails you an updated version of the action. I do know that he has been travelling and is only just back at his desk so he may still be catching up.

Bob
applebox 28 Jun, 2014
Thanks Bob, I hope so. I really need to get this site launched. I can shoot him a quick email today to ask him.
Cheers!
applebox 30 Jun, 2014
Ok, Max got me fixed up on the PayPal side, but I'm just hoping that what I came across with the whole "Magic Quotes" thing was a one-time bug. Moving forward, I'm trying to use CFv5 but if this is an ongoing issue, it's going to make it rough.
You guys are normally on the ball so I trust that if it is a bug, that it will be fixed. I'm sure not many people will either know immediately about the Magic Quotes or won't even know how to turn them off. So if this is a requirement in order for V5 to work, that might be some sort of note that is put on the download page or something. Just a suggestion. I'm a moderate developer (that's not my only function and there are those far better at figuring out code then I), and I wasn't aware of this until I had this problem. Lost a whole day to re-establish the forms in V4. But that's life.
Thanks for at least making me aware of the situation.
Cheers,
Mike
applebox 30 Jun, 2014
I almost totally forgot that there is still the ReCaptcha issue. I'll have to ask Max if there is a patch for that too.
GreyHead 30 Jun, 2014
Hi Mike,

To show the reCaptcha 'image' add a Custom Element element to your form and put {ReCaptcha} in it - see this FAQ.

I never really understood what the problem was that meant that you have to keep Magic Quotes on? They are certainly not needed for Joomla! 2.5 or for CF.

Bob
applebox 30 Jun, 2014
Thanks Bob.
On the Magic Quotes, I know you said they are not needed but my guess is that they are "on" by default (at least with GoDaddy Hosting Package). When I turned them "off" in the PHP.ini file, that's when things went haywire and I lost my form. So I had to undo turning them off (so in essence, keep them on). If the typical procedure is to make sure they are turned "off" first, then I'm not sure that everyone will know that step automatically. This sounds like it should be a process. I looked and I didn't see any kind of Plugin that works with Joomla to turn them off, so in a lot of cases, someone would have to know to go into the PHP.ini file and manually do that. Or am I the only one that had an issue here or the only one on GoDaddy?🙂

I'm really not sure why doing that killed my form though, but for whatever reason, v5 didn't like what I had coded with any apostrophes or quotes. V4 didn't seem to have any issues with the same code.
GreyHead 30 Jun, 2014
Hi Mike,

Hmm . . . maybe the Magic Quotes added slashes had somehow already corrupted something in the code :-(

GoDaddy is not the best or most helpful of webhosts (nor the worst either I suspect). When you install Joomla! 2.5 you should see a little warning message that Magic Quotes are set on. Joomla! 2.5 tolerates them with only the odd hiccup. Max wrote CFV5 assuming that they would be off and that has occasionally caused the odd problem with excessive slashes appearing in saved code but, as far as I recall, hasn’t irrrevocably broken forms before. Usually it's enough to remove the unwanted slashes and re-save the form.

Bob
applebox 30 Jun, 2014
P.S. - The ReCaptcha fix worked (thanks).
applebox 30 Jun, 2014
Well, let's hope this is an isolated incident. But if you see others with the same problem, it might be something for an update down the road. I at least know what to look for if it happens again.
Thanks for the heads-up.
This topic is locked and no more replies can be posted.