Problem with conditional validation

BasilC

Member
Joomla 4.3
Fabrik 4.0Gamma3
PHP8.1 running on XAMPP
Copy of a J3/Fabrik3.1 website

I have an IsNot validation which is supposed to run only under certain conditions. This worked fine on J3, but I can't get it to work on J4.

The validation checks the value of Yes/No element tbl_events___confirm_no_gaps. For certain values of the field tbl_events___regularevent the value must be Yes (ie 1 in the database), otherwise it can be either Yes or No. (There's a second condition too, but I've temporarily removed that one until I can get the first one working.)

In J4 the validation always runs regardless and I get the following error message:

"An error has occurred with a eval'd field - please inform the web-site owner. Debug: Caught exception on eval in validation condition : strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated".

On J3 the condition uses raw values, but I'm aware that these don't work with Fabrik 4. I've tried using labels without success, so I've now edited the labels to be the same numerical values.

I've experimented for testing purposes with simplified versions of the condition, the simplest being

Code:
return '{tbl_events___regularevent}' == '0';

but it still doesn't work.

Any advice? Is this bad coding on my part or a bug?
 
As far as I can see:
At least in condition you can only use the placeholder without _raw - but this is replaced with the raw value.
This is working at my site.

I can't see the "Passing null..." error ( this is only a deprecated message which will be gone if you reduce your J! error level).
Is this in a standard group or in a repeat group or join etc?
 
Thanks troester.

The root of the problem seems to be the complicated history of this particular list. There are several lists - some now no longer used - that use the same table and over the years parent/child relationships between some elements have clearly got very confused, including the element {tbl_events___confirm_no_gaps}.

So I unpublished that element and created a new one {tbl_events___no_gaps} just in the particular list and the conditional validation now works.

Looks like a case where J3 is more forgiving than J4.

Really, I ought to try to disentangle the mess that these lists have got into over the years...
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top