Since upgrading to 3.4.3 syntax error, unexpected '{' in calc elements

softforge

Member
Hi,
We upgraded to 3.4.3 and joomla 3.5.1 and php 7 and since then calculation elements that were workign find bring back a
Error: 0
syntax error, unexpected '{'

We have not changed the syntax and I can guarantee its the calc element as I have gone into a calc element, removed the login and its outputting fine (minus the result the logic would have produced)

Here is the full (slightly cut down ) which fails and below the logic removed that passes so we cant hen below that determine what is causing the problem, question is what should the syntax now be and why is the upgrade changing it?
-------------------------------------------------------------------------
$possible=100;
$score = '{appraisal___capital_review_raw}'+'{appraisal___budget_forecast_raw}'+'{appraisal___auth_process_raw}'+'{appraisal___case_process_raw}'+'{appraisal___appraisal_techniques_raw}'+'{appraisal___key_stakeholders_raw}'+'{appraisal___keep_tab_raw}'+'{appraisal___software_tools_raw}'+'{appraisal___formal_process_raw}'+'{appraisal___post_implementation_raw}';
if({appraisal___capital_review_raw}===""||{appraisal___budget_forecast_raw}===""||{appraisal___auth_process_raw}===""||{appraisal___case_process_raw}===""||{appraisal___appraisal_techniques_raw}===""||{appraisal___key_stakeholders_raw}===""||{appraisal___keep_tab_raw}===""||{appraisal___software_tools_raw}===""||{appraisal___formal_process_raw}===""||{appraisal___post_implementation_raw}===""){
$message = "Please answer all the questions";
}else{

if($score>70){
$message = "Your business has very good control and management of investments, costs and effective delegation. It may still however be worth having your external or internal auditors review the processes for further improvements. Alternatively contact us to provide an independent audit.";
}
}
The above throws the error
-----------------------------------------------------------------------------
$possible=100;
$score = '{appraisal___capital_review_raw}'+'{appraisal___budget_forecast_raw}'+'{appraisal___auth_process_raw}'+'{appraisal___case_process_raw}'+'{appraisal___appraisal_techniques_raw}'+'{appraisal___key_stakeholders_raw}'+'{appraisal___keep_tab_raw}'+'{appraisal___software_tools_raw}'+'{appraisal___formal_process_raw}'+'{appraisal___post_implementation_raw}';


if($score>70){
$message = "Your business has very good control and management of investments, costs and effective delegation. It may still however be worth having your external or internal auditors review the processes for further improvements. Alternatively contact us to provide an independent audit.";
}

The above does not throw any error
so the but thats throwing the error and did not before the upgrade is

if({appraisal___capital_review_raw}===""||{appraisal___budget_forecast_raw}===""||{appraisal___auth_process_raw}===""||{appraisal___case_process_raw}===""||{appraisal___appraisal_techniques_raw}===""||{appraisal___key_stakeholders_raw}===""||{appraisal___keep_tab_raw}===""||{appraisal___software_tools_raw}===""||{appraisal___formal_process_raw}===""||{appraisal___post_implementation_raw}===""){
$message = "Please answer all the questions";
}
The fabrik and the calc plugin are both 3.4.3
 
You should always quote placeholders in php
if('{appraisal___capital_review_raw}'==="" etc

Did your code really work before? {placeholder}==="" would have given e.g. 1==="" (which is false) or ==="" (in case of empty, which is no valid code, even in php5.x)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top