michitux / dokuwiki-plugin-move

Move and rename pages and namespaces whilst maintaining the links
http://www.dokuwiki.org/plugin:move
GNU General Public License v2.0
40 stars 20 forks source link

Undefined array key "move_renameokay" #251

Closed Miro-Collas closed 5 months ago

Miro-Collas commented 1 year ago

Release 2023-04-04a "Jack Jackrum" PHP8.1

2023-08-19 19:40:07E_WARNING: Undefined array key "move_renameokay"/home/fswiki/public_html/lib/plugins/move/action/rename.php(71)
    #0 /home/fswiki/public_html/lib/plugins/move/action/rename.php(71): dokuwiki\ErrorHandler::errorHandler(2, 'Undefined array...', '/home/fswiki/pu...', 71)
    #1 /home/fswiki/public_html/inc/Extension/EventHandler.php(80): action_plugin_move_rename->addsvgbutton(Object(dokuwiki\Extension\Event), Array)
    #2 /home/fswiki/public_html/inc/Extension/Event.php(96): dokuwiki\Extension\EventHandler->process_event(Object(dokuwiki\Extension\Event), 'AFTER')
    #3 /home/fswiki/public_html/inc/Extension/Event.php(136): dokuwiki\Extension\Event->advise_after()
    #4 /home/fswiki/public_html/inc/Extension/Event.php(199): dokuwiki\Extension\Event->trigger(Array, true)
    #5 /home/fswiki/public_html/inc/Menu/AbstractMenu.php(46): dokuwiki\Extension\Event::createAndTrigger('MENU_ITEMS_ASSE...', Array, Array)
    #6 /home/fswiki/public_html/lib/tpl/bootstrap3/Template.php(2328): dokuwiki\Menu\AbstractMenu->getItems()
    #7 /home/fswiki/public_html/lib/tpl/bootstrap3/Template.php(36): dokuwiki\template\bootstrap3\Template->initToolsMenu()
    #8 /home/fswiki/public_html/lib/tpl/bootstrap3/Template.php(120): dokuwiki\template\bootstrap3\Template->__construct()
    #9 /home/fswiki/public_html/lib/tpl/bootstrap3/tpl/global.php(32): dokuwiki\template\bootstrap3\Template::getInstance()
    #10 /home/fswiki/public_html/lib/tpl/bootstrap3/mediamanager.php(13): require_once('/home/fswiki/pu...')
    #11 /home/fswiki/public_html/lib/exe/mediamanager.php(128): include('/home/fswiki/pu...')
    #12 {main}
nerun commented 1 year ago

This is my file ...plugins/move/action/rename.php it fixed this bug to me, and other related to line 42. Please download and try it if you can.

This is a diff between my changes and the file from current master branch. These lines were added. These additions are harmless to the plugin and has no reasons to not add them:

39a40,46
>         
>         if ( !isset($USERINFO['grps']) ){
>             $USERINFO['grps'] = '';
>         }
>         if ( !isset($INFO['id']) ){
>             $INFO['id'] = '';
>         }
72a80,82
>         if ( !isset($JSINFO['move_renameokay']) ){
>             $JSINFO['move_renameokay'] = '';
>         }
Miro-Collas commented 1 year ago

@nerun That seems to work very nicely, thank you! :-)