Error calc element PHP 7.0

merlino68

Member
After updating to php 7.0 with fabrik 3.6 and joomla 3.7 a calculated field sends the error page with the following message: syntax error, unexpected 'if' (T_IF)
no problem with php 5.6
The php calculation is as follows:

$ Dummy = '{tm_test___Vita}';
If ($ dummy <0.94)
{
Return 'Hidden';
}
else
{
Return $ dummy;
}
$ M = if ('{tm_test___Vita_raw}' <1) {$ spoints = 0;}
$ F = if ((int) round (('{tm_test_vita_raw}' / '{tm_test ___ Fianchi_raw}') * 100) / 100; <0.94) {$ spoints = 0;

If ((int) '{tm_test ___ sex_allen}' == Male) {$ spoints = $ dummy;}
else
If ((int) '{tm_test ___ sex_allen}' == Female) {$ spoints = $ f;}
else
$ Spoints = "ND";
Return $ spoints;
 
$ M = if ('{tm_test___Vita_raw}' <1) {$ spoints = 0;}
Not sure if this is valid.
Additionally you have $dummy and $Dummy etc (variable names are case sensitive), (int) '{tm_test ___ sex_allen}' == Male ...
Was this really working with PHP5.6?

But this is a PHP(7) thing, not Fabrik.
 
Dummy is just in tiny (I did not tell it in the tread) and in php 5.6 everything worked, I try to check the syntax in php 7.0

thank you
 
This is valid syntax:

$ M = if ('{tm_test___Vita_raw}' <1) {$ spoints = 0;}

The fact that it doesn't throw a warning or error in 5.x is just luck.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top