dokuwiki-template-bootstrap3 icon indicating copy to clipboard operation
dokuwiki-template-bootstrap3 copied to clipboard

Error during Dokuwiki Upgrade

Open Miro-Collas opened this issue 1 year ago • 11 comments

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

  • [Bootstrap3 Template] Template v2022-07-27 (stable/20220727)
  • [DokuWiki] "Release 2022-07-31a "Igor" to current (2023-04-04a "Jack Jackrum")
  • [Plugins]
  • [PHP] 8.1.18
  • [Browser] Firefox 114.0

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 avatar Jun 01 '23 06:06 Miro-Collas

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

Miro-Collas avatar Jun 01 '23 06:06 Miro-Collas

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

giterlizzi avatar Jun 01 '23 09:06 giterlizzi

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?

yaynstuff avatar Jun 01 '23 12:06 yaynstuff

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)

giterlizzi avatar Jun 03 '23 14:06 giterlizzi

So what do you recommend at this point?

yaynstuff avatar Jun 03 '23 18:06 yaynstuff

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

yaynstuff avatar Jun 05 '23 12:06 yaynstuff

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;
    }

giterlizzi avatar Jun 27 '23 20:06 giterlizzi

[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 avatar Jun 29 '23 04:06 yaynstuff

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.

yaynstuff avatar Jun 29 '23 04:06 yaynstuff

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

Miro-Collas avatar Aug 09 '23 03:08 Miro-Collas

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

Miro-Collas avatar Aug 13 '23 06:08 Miro-Collas