Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot declare class dokuwiki\Menu\Item\AbstractItem #545

Closed
himiq opened this issue Aug 5, 2021 · 8 comments
Closed

Cannot declare class dokuwiki\Menu\Item\AbstractItem #545

himiq opened this issue Aug 5, 2021 · 8 comments

Comments

@himiq
Copy link

himiq commented Aug 5, 2021

Description

Cannot declare class dokuwiki\Menu\Item\AbstractItem

Steps to reproduce

  1. Open Edit Page
  2. Press icon 'Mediamanager"

Versions

  • Bootstrap3 Template v2021-03-11 (stable/20210311)
  • DokuWiki Release 2020-07-29 "Hogfather"
  • PHP 7.3.29
  • FF

Screenshots or Logs

[05-Aug-2021 11:36:43 Europe/Samara] PHP Fatal error: Cannot declare class dokuwiki\Menu\Item\AbstractItem, because the name is already in use in /usr/local/www/dokuwiki/lib/tpl/bootstrap3/compat/inc/Menu/Item/AbstractItem.php on line 20

@himiq himiq added the bug label Aug 5, 2021
@giterlizzi
Copy link
Owner

Hi, please check in doku.php the variable $updateVersion.

The compat library are loaded for DokuWiki version older than Grebo.

Joseph

@himiq
Copy link
Author

himiq commented Aug 11, 2021

$updateVersion = "51.3";

@TJuberg
Copy link

TJuberg commented Aug 27, 2021

I can confirm I am having the exact same problem.

[Fri Aug 27 15:15:41.828346 2021] [php7:error] [pid 1650] PHP Fatal error: Cannot declare class dokuwiki\Menu\Item\AbstractItem, because the name is already in use in /usr/share/dokuwiki/lib/tpl/bootstrap3/compat/inc/Menu/Item/AbstractItem.php on line 20

I can also confirm

$updateVersion = "51.3";

PHP 7.2.24, otherwise identical

@TJuberg
Copy link

TJuberg commented Aug 27, 2021

I did some initial digging on this just to see if I could see anything obvious.
I don't know the dokuwiki codebase or the internal workings at all, but I added two debug strings to ./lib/tpl/bootstrap3/compat/inc/functions.php

global $updateVersion;
$dokuwiki_version = floatval($updateVersion);

error_log("Debug: dokuwiki_version == $dokuwiki_version updateVersion == $updateVersion");

define('DOKU_VERSION', $dokuwiki_version);
define('DOKU_VERSION_HOGFATHER',          51); // 2020-07-29
define('DOKU_VERSION_GREEBO',             50); // 2018-04-22 (PHP >= 5.6)
define('DOKU_VERSION_FRUSTERICK_MANNERS', 49); // 2017-02-19 (PHP >= 5.4 ???)
define('DOKU_VERSION_ELENOR_OF_TSORT',    48); // 2016-06-26
define('DOKU_VERSION_DETRITUS',           47); // 2015-08-10 (PHP >= 5.3.3)


// Load compatibility Menu classes for pre-Greebo releases
if (DOKU_VERSION < DOKU_VERSION_GREEBO) {

    error_log("Debug compat if: dokuwiki_version == $dokuwiki_version updateVersion == $updateVersion");

This results in the following log messages when going to edit a page, and subsquently clicking on the "Add image or other files" button

[Fri Aug 27 15:39:45.197920 2021] [php7:notice] [pid 1650] Debug: dokuwiki_version == 51.3 updateVersion == 51.3, referer: https://domain/doku.php?id=start&do=edit
[Fri Aug 27 15:39:48.453156 2021] [php7:notice] [pid 908] Debug: dokuwiki_version == 51.3 updateVersion == 51.3, referer: https://domain/doku.php?id=start
[Fri Aug 27 15:39:58.097798 2021] [php7:notice] [pid 911] Debug: dokuwiki_version == 0 updateVersion == , referer: https://domain/doku.php?id=start&do=edit
[Fri Aug 27 15:39:58.097837 2021] [php7:notice] [pid 911] Debug compat if: dokuwiki_version == 0 updateVersion == , referer: https://domain/doku.php?id=start&do=edit

So something is causing the variable to not be set seemingly only when trying to call media manager from the edit dialogue via the button.

Accessing the media manager by other means yields no errors.

@Le1b1
Copy link

Le1b1 commented Jan 31, 2022

Same error here, did some manage to fix it?

@neo7904
Copy link

neo7904 commented Feb 10, 2022

In my case, when I installed "Stale plugin", the corresponding error occurred. I solved the problem by deleting it. please use file content search to find php files that use the "AbstractMenu" class and find the cause. :-)

@Le1b1
Copy link

Le1b1 commented Feb 10, 2022

I solved the problem by deleting it.

Fixed it for me, too. Thanks!

@neo7904
Copy link

neo7904 commented Feb 10, 2022

I solved the problem by deleting it.

Fixed it for me, too. Thanks!

Good for you! You're welcome. Have a nice day!

@giterlizzi giterlizzi added this to the v2022-04 milestone Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants