giterlizzi / dokuwiki-template-bootstrap3

Bootstrap-based template for DokuWiki
https://dokuwiki.org/template:bootstrap3
GNU General Public License v2.0
220 stars 77 forks source link

Warnings after upgrade to 2023-04-04a "Jack Jackrum" #597

Closed FlyveHest closed 9 months ago

FlyveHest commented 1 year ago

Description

Lots of E_WARNINGS in log

Related to #596 (I got the same error during upgrade)

Looks like the template is using functionality that has been deprecated in DokuWiki.

Steps to reproduce

  1. Run DokuWiki 2023-04-04a "Jack Jackrum"
  2. Load a page
  3. Check log

Expected behavior: Nothing out of the ordinary

Actual behavior: Lots of these warnings in log

2023-06-26 08:51:28 E_WARNING: Undefined array key 1 .../inc/Debug/DebugHelper.php(89)
    #0 .../inc/Debug/DebugHelper.php(89): dokuwiki\ErrorHandler::errorHandler()
    #1 .../inc/Debug/PropertyDeprecationHelper.php(83): dokuwiki\Debug\DebugHelper::dbgDeprecatedProperty()
    #2 .../lib/tpl/bootstrap3/iconify.php(82): dokuwiki\Cache\Cache->__set()
    #3 {main}

2023-06-26 08:51:28 E_WARNING: Trying to access array offset on value of type null .../inc/Debug/DebugHelper.php(90)
    #0 .../inc/Debug/DebugHelper.php(90): dokuwiki\ErrorHandler::errorHandler()
    #1 .../inc/Debug/PropertyDeprecationHelper.php(83): dokuwiki\Debug\DebugHelper::dbgDeprecatedProperty()
    #2 .../lib/tpl/bootstrap3/iconify.php(82): dokuwiki\Cache\Cache->__set()
    #3 {main}

Versions

giterlizzi commented 1 year ago

The Bootstrap3 template uses a legacy features for work in earlier versions of DokuWiki, but this error seems related to the helper debugging utility.

ant5 commented 1 year ago

Also, all icons are disappeared. This is related to iconify.php which response with:

Warning: Undefined array key 1 in /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php on line 52

Warning: Trying to access array offset on value of type null in /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php on line 66

Warning: Undefined array key 1 in /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php on line 89

Warning: Trying to access array offset on value of type null in /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php on line 90

Warning: Trying to access array offset on value of type null in /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php on line 90

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php:52) in /usr/local/www/dokuwiki/lib/tpl/bootstrap3/iconify.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php:52) in /usr/local/www/dokuwiki/inc/httputils.php on line 220

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php:52) in /usr/local/www/dokuwiki/inc/httputils.php on line 221

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php:52) in /usr/local/www/dokuwiki/inc/httputils.php on line 30

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/dokuwiki/inc/Debug/DebugHelper.php:52) in /usr/local/www/dokuwiki/inc/httputils.php on line 31

instead of image content.

FlyveHest commented 1 year ago

Did a little digging, and while the entire template could probably use a once-over in regards to the big changes in DokuWiki, I found that doing the following removed the errors and warnings in my logs.

In tpl/bootstrap3/iconify.php (around line 81)

Change

$cache = new cache($cache_key, '.js');'

To

$cache = new dokuwiki\Cache\Cache($cache_key, '.js');

And change

$cache->_event = 'ICONIFY_CACHE';

to

$cache->setEvent('ICONIFY_CACHE');

In tpl/bootstrap3/Template.php:2231

Change

trigger_event('TPL_TOC_RENDER', $toc, null, false);

to

\dokuwiki\Extension\Event::createAndTrigger('TPL_TOC_RENDER', $toc, null, false);

anto54 commented 1 year ago

Did a little digging, and while the entire template could probably use a once-over in regards to the big changes in DokuWiki, I found that doing the following removed the errors and warnings in my logs.

In tpl/bootstrap3/iconify.php (around line 81)

Change

$cache = new cache($cache_key, '.js');'

To

$cache = new dokuwiki\Cache\Cache($cache_key, '.js');

And change

$cache->_event = 'ICONIFY_CACHE';

to

$cache->setEvent('ICONIFY_CACHE');

In tpl/bootstrap3/Template.php:2231

Change

trigger_event('TPL_TOC_RENDER', $toc, null, false);

to

\dokuwiki\Extension\Event::createAndTrigger('TPL_TOC_RENDER', $toc, null, false);

Thank you !

hruettimann commented 10 months ago

Did a little digging, and while the entire template could probably use a once-over in regards to the big changes in DokuWiki, I found that doing the following removed the errors and warnings in my logs.

In tpl/bootstrap3/iconify.php (around line 81)

Change

$cache = new cache($cache_key, '.js');'

To

$cache = new dokuwiki\Cache\Cache($cache_key, '.js');

And change

$cache->_event = 'ICONIFY_CACHE';

to

$cache->setEvent('ICONIFY_CACHE');

In tpl/bootstrap3/Template.php:2231

Change

trigger_event('TPL_TOC_RENDER', $toc, null, false);

to

\dokuwiki\Extension\Event::createAndTrigger('TPL_TOC_RENDER', $toc, null, false);

Thank you! This helped. In addition to all of the changes above I had to add the following line to the iconify.php file, right after the PHP declaration at line 2.

use dokuwiki\Cache\Cache;