Hi everyone!
I have been playing with an installation of DokuWiki 2022-07-31a “Igor” on Windows 10 with Wampserver 3.3.0 running PHP 8.0.26 and Apache 2.4.54.2. I have been using the "ReadTheDokus" template.
More often than I could expect, pages are frequently prepended by PHP messages about warnings about code in some plugins. It happens all of a sudden after I do things like creating a page or namespace, or adding a tag to a page. Something like that, but inside a pretty (?) table I have not copied:
Warning: Undefined array key "src" in C:\wamp64\www\dw\lib\plugins\translation\action.php on line 97
Call Stack
# Time Memory Function Location
1 0.0002 366928 {main}( ) ...\doku.php:0
2 0.0240 800296 act_dispatch( ) ...\doku.php:126
3 1.1547 843480 include( 'C:\wamp64\www\dw\lib\tpl\readthedokus\main.php ) ...\actions.php:27
4 1.1550 853808 tpl_metaheaders( $alt = ??? ) ...\main.php:22
5 1.1584 879976 dokuwiki\Extension\Event::createAndTrigger( $name = 'TPL_METAHEADER_OUTPUT', $data = ['meta' => [0 => [...], 1 => [...]], 'link' => [0 => [...], 1 => [...], 2 => [...], 3 => [...], 4 => [...], 5 => [...], 6 => [...], 7 => [...], 8 => [...]], 'script' => [0 => [...], 1 => [...], 2 => [...], 3 => [...]]], $action = '_tpl_metaheaders_action', $canPreventDefault = TRUE ) ...\template.php:364
6 1.1584 880136 dokuwiki\Extension\Event->trigger( $action = '_tpl_metaheaders_action', $enablePrevent = TRUE ) ...\Event.php:199
7 1.1584 880136 dokuwiki\Extension\Event->advise_before( $enablePreventDefault = TRUE ) ...\Event.php:132
8 1.1584 880136 dokuwiki\Extension\EventHandler->process_event( $event = class dokuwiki\Extension\Event { public $name = 'TPL_METAHEADER_OUTPUT'; public $data = ['meta' => [...], 'link' => [...], 'script' => [...]]; public $result = NULL; public $canPreventDefault = TRUE; protected $runDefault = TRUE; protected $mayContinue = TRUE }, $advise = 'BEFORE' ) ...\Event.php:74
9 1.1584 880224 action_plugin_translation->translateJS( $event = class dokuwiki\Extension\Event { public $name = 'TPL_METAHEADER_OUTPUT'; public $data = ['meta' => [...], 'link' => [...], 'script' => [...]]; public $result = NULL; public $canPreventDefault = TRUE; protected $runDefault = TRUE; protected $mayContinue = TRUE }, NULL ) ...\EventHandler.php:81
Sure, I plan to report such warnings to the respective plugin authors. I presume it might be something related to PHP 8 being more restrictive than 7.x or whatever was used when the code was written.
However, what I would like to ask is: is there a way to block such PHP warning messages to be shown in DokuWiki pages? Is there any configuration option in DokuWiki itself or in PHP for that?
Thank you!
Fabricio Rocha
Brasilia, Brasil