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

Error during Dokuwiki Upgrade #596

Closed Miro-Collas closed 9 months ago

Miro-Collas commented 1 year ago

Description

Attempting to upgrade from "Release 2022-07-31a "Igor" to current (2023-04-04a "Jack Jackrum") throws an error - trace provided. Setting the system template to docuwiki instead of the bootstrap theme allows the upgrade to succeed with no error.

Steps to reproduce

  1. Update all extensions and templates
  2. Begin upgrade process using the DokuWiki Upgrade Plugin

Expected behavior: Successful wiki upgrade

Actual behavior: Error below

Versions

Screenshots or Logs

Error: Call to undefined method dokuwiki\Logger::isLogging()
/home/wikihome/public_html/inc/Debug/DebugHelper.php(26)
#0 /home/wikihome/public_html/inc/Debug/DebugHelper.php(45): dokuwiki\Debug\DebugHelper::isEnabled()
#1 /home/wikihome/public_html/inc/infoutils.php(461): dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction('\\dokuwiki\\Exten...', 2)
#2 /home/wikihome/public_html/inc/deprecated.php(340): dbg_deprecated('\\dokuwiki\\Exten...')
#3 /home/wikihome/public_html/lib/tpl/bootstrap3/Template.php(2231): trigger_event('TPL_TOC_RENDER', Array, NULL, false)
#4 /home/wikihome/public_html/lib/tpl/bootstrap3/main.php(120): dokuwiki\template\bootstrap3\Template->getTOC(true)
#5 /home/wikihome/public_html/inc/actions.php(27): include('/home/fswiki/pu...')
#6 /home/wikihome/public_html/doku.php(126): act_dispatch()
#7 {main}

Sample page or snippet

[Paste your sample DokuWiki page or snippet using MarkDown code syntax]

Miro-Collas commented 1 year ago

Our sysadmin adds:

https://www.dokuwiki.org/changes#release_2022-07-31b_igor it looks like code changes in 31b Refactored logging mechanism 3230, 3203 and logviewer i suspect thats whats broken it

giterlizzi commented 1 year ago

It seems that the DokuWiki upgrade did not complete correctly because some method is missing in the library used for logging.

yaynstuff commented 1 year ago

I am not entirely convinced this is a problem with Dokuwiki itself, or there would be widespread complaints. The upgrade completes fine if we disable your template - any thoughts on that?

giterlizzi commented 1 year ago

The template uses a DokuWiki function that is now deprecated (trigger_event) but is used in older versions of DokuWiki. In this case, DokuWiki reports (in the log) that a deprecated function is being used and continues execution of the page. From the stack you attached the error is due to a missing dokuwiki\Logger::isLogging() method.

https://xref.dokuwiki.org/reference/dokuwiki/nav.html?inc/Logger.php.html (line 154)

yaynstuff commented 1 year ago

So what do you recommend at this point?

yaynstuff commented 1 year ago

Note, this is treated as an error level event and execution stops. Screenshot_20230601_152550

giterlizzi commented 1 year ago

You have dokuwiki\Logger->isLogging() method in your DokuWiki instance (in DOKU_INC/Logger.php file) ?

https://github.com/dokuwiki/dokuwiki/blob/509edb6901bb59e8f8eeffd003d34c6664b84d44/inc/Logger.php#L154

    /**
     * Is this logging instace actually logging?
     *
     * @return bool
     */
    public function isLogging()
    {
        return $this->isLogging;
    }
yaynstuff commented 1 year ago
[yay@srv inc]# grep 'isLogging' Logger.php 
    protected $isLogging = true;
        if (in_array($facility, $dontlog)) $this->isLogging = false;
        if (!$this->isLogging) return false;

[yay@srv inc]# grep 'actually' Logger.php 
[yay@srv inc]#

That public function is not present in that file but there is some mention of it if I grep for isLogging

yaynstuff commented 1 year ago

Which makes sense because we're still on the original version:

https://github.com/dokuwiki/dokuwiki/blob/release-2022-07-31a/inc/Logger.php

It appears this is the Logger.php we have right now.

Miro-Collas commented 1 year ago

Any news here? We are still pending the Doluwiki upgrade as this issue is blocking.

Miro-Collas commented 1 year ago

Work-around, for any others affected:

  1. In Dokuwiki settings, set the template to Dokuwiki
  2. run the upgrader
  3. set the template back to Bootstrap3
  4. cross fingers'n'toes that there are no other errors

This pending an actual fix, of course.

See also https://github.com/giterlizzi/dokuwiki-template-bootstrap3/issues/597