splitbrain / dokuwiki-plugin-bureaucracy

Create forms and generate pages or emails from them
http://www.dokuwiki.org/plugin:bureaucracy
GNU General Public License v2.0
43 stars 47 forks source link

PHP error after upgrading to 2021-03-19 #294

Closed WordsOfMe closed 3 years ago

WordsOfMe commented 3 years ago

Upgrading to the latest version brings dokuwiki down:

[Mon Jun 21 23:36:45.065641 2021] [fcgid:warn] [pid 19833] [client 192.0.2.0:50762] mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '?' in /var/www/wiki.example.com/lib/plugins/bureaucracy/syntax.php on line 542, referer: https://wiki.example.com/

(redacted for privacy)

Klap-in commented 3 years ago

On line 542 we find: https://github.com/splitbrain/dokuwiki-plugin-bureaucracy/blob/3373d1524a23dce933a0a9b62b267eafebd4c49c/syntax.php#L542

I guess this is recent php syntax, probably you are using an older php version.

Which version of php do you use on your system?

WordsOfMe commented 3 years ago

php 5.6, which satisfies the dokuwiki requirements as per https://www.dokuwiki.org/requirements

Klap-in commented 3 years ago

Sure. It is introduced by https://github.com/splitbrain/dokuwiki-plugin-bureaucracy/commit/dbe43fdf031ae1f42760b50ed07505202178db79

This is syntax since php7. https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op

(Note please note that the next DokuWiki will drop support for all versions before 7.2, so if the fix here is not coming quick enough you can change this line yourself, or already update to newer version of php)

e.g.

 $match[2] = $match[2] ? $match[2] : $conf['dformat']; 
WordsOfMe commented 3 years ago

...understood. So as bureaucracy now requires php 7.x and the next dokuwiki release will require php 7.2 anyway I will upgrade the php packages right now. Thanks!