Fatal Error: PHP 7.2 Syntax Error (breaking whole site)
-
This plugin should either look to no longer claim it supports PHP 7.2, or make sure it actually does so those that might still be on PHP 7.2 for one reason or another don’t find their site going offline due to a plugin update.
This is the exact error I got:
Parse error: syntax error, unexpected ')' in /wp-content/plugins/zero-bs-crm/includes/ZeroBSCRM.DAL3.Export.php on line 282
This happens due to PHP 7.2 not liking when the arguments are being provided when a function is being called is given a trailing comma. This type of thing isn’t an issue with arrays & things, but is very much a fatal error in situations like this one (when that comma really isn’t doing anything other than introducing a potential point of failure with certain PHP versions.)
Editing
includes/ZeroBSCRM.DAL3.Export.php
:// retrieve segment $availObjs = $zbs->DAL->segments->getSegmentAudience( $extraParams['segment']['id'], -1, // all, no paging -1, // all, no paging );
to instead be:
// retrieve segment $availObjs = $zbs->DAL->segments->getSegmentAudience( $extraParams['segment']['id'], -1, // all, no paging -1 // all, no paging );
fixes the issue (note how the trailing comma in the function call was removed… thankfully it’s super simple.)
The site came back online after making that one edit.
- The topic ‘Fatal Error: PHP 7.2 Syntax Error (breaking whole site)’ is closed to new replies.