Open pyuxiang opened 1 year ago
Resolution is relatively straightfoward - replace the if-else condition in lines 95-99 of $DOKUWIKI/lib/plugins/toctweak/helper.php
:
with just the else-clause from line 98:
$toc = p_get_metadata($id,'description tableofcontents');
When the tableofcontents
variable is dynamically retrieved, the $toc
will be assigned null
and immediately exits the TOC render function. Not sure what side-effects there are, so leaving it as a comment.
When accessing a deleted page, i.e. by removing page contents, the following error message is thrown by PHP:
Dump of Dokuwiki error log
``` 2022-12-26 11:51:31 /var/www/dokuwiki/lib/plugins/toctweak/helper.php(96) TypeError: Cannot access offset of type string on string #0 /var/www/dokuwiki/lib/plugins/toctweak/syntax/sidetoc.php(73): helper_plugin_toctweak->get_metatoc() #1 /var/www/dokuwiki/inc/parser/renderer.php(117): syntax_plugin_toctweak_sidetoc->render() #2 /var/www/dokuwiki/inc/parserutils.php(682): Doku_Renderer->plugin() #3 /var/www/dokuwiki/inc/parserutils.php(149): p_render() #4 /var/www/dokuwiki/inc/parserutils.php(89): p_cached_output() #5 /var/www/dokuwiki/inc/template.php(1585): p_wiki_xhtml() #6 /var/www/dokuwiki/lib/tpl/dokuwiki/main.php(43): tpl_include_page() #7 /var/www/dokuwiki/inc/actions.php(27): include('...') #8 /var/www/dokuwiki/doku.php(126): act_dispatch() #9 {main} ```Cause seems to be due to
$INFO['meta']
array being unpopulated for such deleted pages,This issue does not manifest when the page itself has not been previously created, nor did it appear in Dokuwiki Hogfather running PHP 7.4 (Ubuntu 20.04).
Environment: