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

Error: Undefined constant "XSLTProcessor" #8

Closed
Stikus opened this issue Feb 14, 2024 · 1 comment
Closed

Error: Undefined constant "XSLTProcessor" #8

Stikus opened this issue Feb 14, 2024 · 1 comment

Comments

@Stikus
Copy link

Stikus commented Feb 14, 2024

Hello @qky666 , I understand that plugin development have stopped years ago, but it was working fine for me.

But after update to php 8+ I got this error:
image

2024-02-14 10:19:01     /opt/www/wiki.cspfmba.ru/lib/plugins/odtplus2dw/action.php(214) Error: Undefined constant "XSLTProcessor"                    
  #0 /opt/www/wiki/lib/plugins/odtplus2dw/action.php(126): action_plugin_odtplus2dw->_odtplus2dw()                                        
  #1 /opt/www/wiki/inc/Extension/EventHandler.php(80): action_plugin_odtplus2dw->_parser(Object(dokuwiki\Extension\Event), Array)         
  #2 /opt/www/wiki/inc/Extension/Event.php(75): dokuwiki\Extension\EventHandler->process_event(Object(dokuwiki\Extension\Event), 'BEFORE')
  #3 /opt/www/wiki/inc/ActionRouter.php(83): dokuwiki\Extension\Event->advise_before()                                                    
  #4 /opt/www/wiki/inc/ActionRouter.php(49): dokuwiki\ActionRouter->setupAction('odtplus2dw')                                             
  #5 /opt/www/wiki/inc/ActionRouter.php(62): dokuwiki\ActionRouter->__construct()                                                         
  #6 /opt/www/wiki/inc/actions.php(19): dokuwiki\ActionRouter::getInstance(true)                                                          
  #7 /opt/www/wiki/doku.php(131): act_dispatch()                                                                                          
  #8 {main}          

According to code https://github.com/qky666/dokuwiki-plugin-odtplus2dw/blob/master/action.php#L214-L216:

    // Class Control
    if ( ! class_exists( XSLTProcessor ) ) return $this->_msg('er_class_xsltProcessor');
    if ( ! class_exists( ZipArchive ) ) return $this->_msg('er_class_zipArchive');
    if ( ! class_exists( DOMDocument ) ) return $this->_msg('er_class_domDocument');
    // Create instance of needed class
    $this->XSLT = new XSLTProcessor;
    $this->ZIP  = new ZipArchive;
    $this->XSL  = new DOMDocument;
    $this->XML  = new DOMDocument;

and my tests - small edition - adding quotes to XSLTProcessor, ZipArchive and DOMDocument in class_exists statement fixes the problem.

Can you add this fix? Without it, I have to manually patch our file.

@qky666
Copy link
Owner

qky666 commented Feb 14, 2024

Hello @Stikus ,
I'm not working in this plugin (or even using Dokuwiki) anymore, but I don't mind making changes if they are useful to anyone. I hope the problem is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants