syntax error, unexpected 'for' (T_FOR) - Fabrik list module - php7

chris.paschen

Chris Paschen
We have a page that has a google map visualization and a fabrik list module.
Everything was working fine until we upgraded the server to php7.
Once we do that, we get the following error:

The requested page can't be found.
If difficulties persist, please contact the System Administrator of this site and report the error below.

0 syntax error, unexpected 'for' (T_FOR)​

If we disable the list module, everything works fine.

The strange thing is that we have an almost identical page (displaying different data from the same table - they both have a filter on one field to show only a certain 'category' of data).
One works, fine, the other gives this error.

Has anyone seen this error before, or have any idea where to look?
 
Isn't the error showing a file name and a line number?

Do you have custom code (e.g. a php plugin, a condition, a calc element...) which may use element placeholders without quotes etc?
 
I can't replicate this either. PHP 7, J! 3.6.2, latest github.

As Troester said, is there not a more detailed error message, giving a file and line number?

-- hugh
 
Thanks for the tip. I do have a calculated field that was being displayed (a formatted/calculated date listing).

Here's the code:

// set variables
$startdate = new DateTime('{spr_events___date_start}');
$enddate = new DateTime('{spr_events___date_end}');


$startmonth = $startdate->format("M");
$endmonth = $enddate->format("M");

// Get Starting date
$displaydate = $startdate->format("M j");

// Get Ending date
// Check if need to repeat month
If ($startmonth <> $endmonth) {
$displaydate = $displaydate . $enddate->format(" - M j");
} else {
$displaydate = $displaydate . $enddate->format("-j");
}

//check for date confirmed
if ('{spr_events___event_date_confirmed_raw}' == 1) {
$displaydate = $displaydate;
} else {
$displaydate = '(TBA)';
}


//$displaydate = 'working';

Return $displaydate;
Everything 'looks' like it is properly quoted there.

I was able to get a work-around by creating a new Lisa on the same data table.
But I'm still not sure why this was causing the problem in the first place.
 
And it's not giving you a file / line number in the error message?

Have you checked the server error logs?

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

Thank you.

Members online

Back
Top