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

FR_DeveloperFR_Developer Posts: 2Questions: 1Answers: 0

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

  • FR_DeveloperFR_Developer Posts: 2Questions: 1Answers: 0

    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

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Many thanks for letting me know about that error. I've committed the fix here.

    Regards,
    Allan

Sign In or Register to comment.