PHP Modification to an existing Wordpress plugin.

Hi! I’m building a website using WordPress and have a problem with the WordPress Form Manager plugin (campbellhoffman.com/form-manager/).

I created a form with 99 form objects/fields and it appears that the plugin will not let me save the form with any additional fields. I’m assuming this is something that can be modified possibly in the code to be able to go beyond 99 items. (It’s written in PHP).

It seems like it should be a quick fix if you can do it. Anyway care to take a gander and let me know how much you want if you can? Thanks.

Couldnt find anything with a quick look through.
Is it giving you an error message or something? Or just not adding the additional fields?
Are you editing an original form to input the 100th? or is it adding from new?

No error message. It saves via AJAX. I can add additional fields but can not save them. (The AJAX circle simply spins forever.) If I modify any of the 99 fields or delete some it saves just fine. So lets say I have 95 fields, and I add 4, it will save just fine. But if I add 5 fields (to make it 100), the AJAX circle spins and it does not save any of them.

In Ajax.php

Replace the is_valid_array_expr with this.
[php]if(is_valid_array_expr($item[‘extra’])){
eval("$newExtra = “.$item[‘extra’].”;");
}else{
/* translators: This error occurs if the save script failed for some reason. */
_e(“Error: Save posted an invalid array expression.”, ‘wordpress-form-manager’)."
";
echo $item[‘extra’];
die();
}[/php]
Also php.net uses eval as
[php]eval("$newExtra = “$item[‘extra’]”;");[/php]
I’m not sure if it will make any difference but worth trying it

@lothop: just tried it. same thing. saves just fine at 99 items. bonks out at 100.

I cant find anything out of the ordinary that would cause the script to hang on the 100th field.
My last suggestion would be to disable your browsers javascript and make the addon save using php only instead of java (looks like is setup to do it both ways)

If that doesn’t work then I’m not sure what you can do except wait for a response from the addon forum or wait for someone more experienced to help you out

I tried disabling javascript but by doing so it won’t let me add any additional fields. Thanks for you help. I really appreciate it.

Other option would be to open the database and put in your last fields yourself following the same format.
Not really elegant but could solve your unique problem

eval() - seriously? tut tut…

Someone once said to me “if eval() is the answer, you are asking the wrong question”…

Well seeing as its in the original addon for wordpress, I didnt want to change it

Sponsor our Newsletter | Privacy Policy | Terms of Service