Editor-PHP-2.0.8 SearchBuilderOptions.php incompatibility with PHP 5.3.x
Editor-PHP-2.0.8 SearchBuilderOptions.php incompatibility with PHP 5.3.x
Error messages shown:
Parse error: syntax error, unexpected '[' in /var/www/secure/includes/DataTables/Editor-PHP-2.0.8/lib/Editor/SearchBuilderOptions.php on line 316
Description of problem:
On line 313-316 you establish an array with the method established in PHP 5.4.x.
// Set up the join variable so that it will fit nicely later
$leftJoin = gettype($this->_leftJoin) === 'array' ?
$this->_leftJoin :
[$this->_leftJoin];
On the download page for Editor PHP, you state that Editor is 5.3.x compatible. With how the above code is written, the SearchBuilderOptions integration currently isn't.
Answers
Re-writing it to
// Set up the join variable so that it will fit nicely later
$leftJoin = gettype($this->_leftJoin) === 'array' ?
$this->_leftJoin :
array($this->_leftJoin);
Fixed the issue
Many thanks for letting me know about that error. I've committed the fix here.
Regards,
Allan