ontarget
Active Member
Hi,
I started this thread as a repository of errors i may encounter into my journey into php8.1 with Fabrik 3.10 in a hope to extend the life of some of my projects.
I have just updated a backup of a site to Joomla 3.10.11, Fabrik 3.10 from git and php8.1
Most of my lists are loading ok in the backend however one shows:
An error has occurred.
0 Unsupported operand types: string + string
I have narrowed it down to a calc element which is:
FIX:I guess i need to cast the data correctly for php8 - this did the trick:
Ajax Calculation:
I have the following calc element with ajax calculation = Yes
Basically the calc element just hangs with the spinner icon "Loading"
FIX: again my poor / slack coding - need to use single quotes 'COMM'
I started this thread as a repository of errors i may encounter into my journey into php8.1 with Fabrik 3.10 in a hope to extend the life of some of my projects.
I have just updated a backup of a site to Joomla 3.10.11, Fabrik 3.10 from git and php8.1
Most of my lists are loading ok in the backend however one shows:
An error has occurred.
0 Unsupported operand types: string + string
I have narrowed it down to a calc element which is:
PHP:
$attendance = ((int)'{aaa_maindatabase___main_total_pp}' + '{aaa_maindatabase___main_total_primary}') * (int)'{aaa_maindatabase___main_sessions}';
if($attendance >= 1)
{
return $attendance;
}
else
{
return '{aaa_maindatabase___attendance}';
}
FIX:I guess i need to cast the data correctly for php8 - this did the trick:
PHP:
$attendance = ((int)'{aaa_maindatabase___main_total_pp}' + (int)'{aaa_maindatabase___main_total_primary}') * (int)'{aaa_maindatabase___main_sessions}';
if($attendance >= 1)
{
return $attendance;
}
else
{
return '{aaa_maindatabase___attendance}';
}
Ajax Calculation:
I have the following calc element with ajax calculation = Yes
Basically the calc element just hangs with the spinner icon "Loading"
PHP:
if ('{aaa_maindatabase___main_provider}' != COMM) {
$catering = array_sum($data[(int)'aaa_maindatabase___main_catering_detail_raw']) + (int)'{aaa_maindatabase___main_other_catering}';
$totalcatering = $catering * (int)'{aaa_maindatabase___main_served}';
return $totalcatering;
}
else {
$catering = array_sum($data[(int)'aaa_maindatabase___main_catering_detail_comm_raw']) + (int)'{aaa_maindatabase___main_other_catering}';
$totalcatering = $catering * (int)'{aaa_maindatabase___main_served}';
return $totalcatering;
}
PHP:
if ('{aaa_maindatabase___main_provider}' != 'COMM') {
Last edited: