Fatal Error with PHP Validation

lszlsz

New Member
Hi

I wanted to use a php validation for a simple text field. Simple code, just adding some prefix to a text field.

Upon sending the form I get this error:

Fatal error: Cannot use object of type stdClass as array in /home/usr/g-fras/public_html/plugins/fabrik_validationrule/php/php.php on line 69

I'm running 3.07 on J25.
I upgraded to the latest gthub version - but only the php validation plugin.

Kindly
Lorenz
 
Two things:
  1. When you upgrade from GitHub, you have to upload ALL files, not just one plugin as code changes often affects many cores files also.
  2. You should post the PHP code you use for the validation so we can see whether there is an error in it.
 
I think for this kind of application, you'd better use the calc element: it allows you to perform "actions" on any element on the form.
So say that that your element is called "myelement", recording in the database table "mytable", add a hidden calc element in your form and write this as a calculation:
PHP:
return 'prefix'.'{mytable___myelement'};
You can choose to show this element and hide the "myelement" in list view so your modified text entry would show in the list.
 
Hi
Thanks for the tip, works well.

I have an additional question:
How would I install a validation that sets all characters of an text field to lower case?

Kindly
Lorenz
 
hi
Add a php validation plugin and set
match or replace: replace

and in the code text area enter:

PHP:
return strtolower($data);
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top