Fweeb/dokuwiki_plugin_html5video

Declaration Errors Received Upon Installation

Opened this issue · 2 comments

I receive the following errors upon installing this plugin. I'm using PHP 7 and DokuWiki 2015-08-10 "Detritus"

  • Warning: Declaration of syntax_plugin_html5video_video::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in C:\xampp\htdocs\dokuwiki\lib\plugins\html5video\syntax\video.php on line 145
  • Warning: Declaration of syntax_plugin_html5video_video::render($mode, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in C:\xampp\htdocs\dokuwiki\lib\plugins\html5video\syntax\video.php on line 145

I can confirm the error. It was into "2015-08-10a detritus"
After update to "2016-06-26 elenor of tsort" problem is not resolved
A couple of strings from nginx error log (real domain name replaced with %wiki-domain%, ip hidden with ?.?.?.?)

2016/06/28 15:12:54 [error] 20244#20244: *223 FastCGI sent in stderr: "PHP message: PHP Warning:  Declaration of syntax_plugin_html5video_video::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/%wiki-domain%/lib/plugins/html5video/syntax/video.php on line 24
PHP message: PHP Warning:  Declaration of syntax_plugin_html5video_video::render($mode, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/%wiki-domain%/lib/plugins/html5video/syntax/video.php on line 24" while reading response header from upstream, client: ?.?.?.?, server: %wiki-domain%, request: "GET /doku.php?id=linux:ubuntu:nginx:configuration HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "%wiki-domain%", referrer: "https://%wiki-domain%/doku.php?id=start"

BTW, errors are adding to error log even when you're opening page without embeded video where plugin may be called.

Quick look to source shows that string where refers message is:
class syntax_plugin_html5video_video extends DokuWiki_Syntax_Plugin {
So far I guess that something wrong wit function declaration.

Is this plugin still supportable? At plugin page https://www.dokuwiki.org/plugin:html5video

Last updated on: 2013-03-07

More then 3 years...

I ran into the same thing. If you change:

    public function render($mode, &$renderer, $data) {

to:

    public function render($mode, $renderer, $data) {

This will fix the error; the method signature is just wrong (it's assuming by reference via &)