restlessminded / dokuwiki-plugin-svgEmbed

A dokuwiki plugin that allows the use of the standard media syntax, but SVG files are placed with the <embed> tag, not the <img> tag.
GNU General Public License v2.0
1 stars 2 forks source link

Error: Call to a member function attributes() on bool #18

Open jlpoolen opened 2 weeks ago

jlpoolen commented 2 weeks ago

On August 29, 2024, I am running the current high watermark of Dokuwiki:

Wiki Upgrade
DokuWiki 2024-02-06b "Kaos" is available for download.
You're currently running DokuWiki 2024-02-06b "Kaos".
Your current DokuWiki is already up to date. No need for upgrading.

Today I installed firefox_2024-08-29_09-50-45

When I tried displaying an SVG (known to display correctly), I get the following error message: firefox_2024-08-29_09-46-08

jlpoolen commented 2 weeks ago

I tried reinstalling firefox_2024-08-29_09-53-21

and the same error occurs:

jlpoolen commented 2 weeks ago

I reproduced the error by clicking the Preview button during an edit of the playground page and captured the following error messages:


jlpoole@ares ~ $ date; tail -f /var/www/localhost/htdocs/dokuwiki/data/log/error/2024-08-29.log -n 0 |nl
Thu Aug 29 10:02:29 PDT 2024
     1  2024-08-29 17:02:37     /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(207) E_WARNING: simplexml_load_file(): /var/www/localhost/htdocs/dokuwiki/data/media/playground/sle_airportdiagram_from_nw1_dl20240426-4.svg:1835: parser error : Excessive depth in document: 256 use XML_PARSE_HUGE option
     2    #0 [internal function]: dokuwiki\ErrorHandler::errorHandler()
     3    #1 /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(207): simplexml_load_file()
     4    #2 /var/www/localhost/htdocs/dokuwiki/inc/parser/renderer.php(126): syntax_plugin_svgembed->render()
     5    #3 /var/www/localhost/htdocs/dokuwiki/inc/parserutils.php(691): Doku_Renderer->plugin()
     6    #4 /var/www/localhost/htdocs/dokuwiki/inc/Ui/PageView.php(56): p_render()
     7    #5 /var/www/localhost/htdocs/dokuwiki/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
     8    #6 /var/www/localhost/htdocs/dokuwiki/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
     9    #7 [internal function]: tpl_content_core()
    10    #8 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(134): call_user_func_array()
    11    #9 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    12    #10 /var/www/localhost/htdocs/dokuwiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    13    #11 /var/www/localhost/htdocs/dokuwiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    14    #12 /var/www/localhost/htdocs/dokuwiki/inc/actions.php(30): include('...')
    15    #13 /var/www/localhost/htdocs/dokuwiki/doku.php(131): act_dispatch()
    16    #14 {main}
    17  2024-08-29 17:02:37     /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(207) E_WARNING: simplexml_load_file():                                 &lt;path
    18    #0 [internal function]: dokuwiki\ErrorHandler::errorHandler()
    19    #1 /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(207): simplexml_load_file()
    20    #2 /var/www/localhost/htdocs/dokuwiki/inc/parser/renderer.php(126): syntax_plugin_svgembed->render()
    21    #3 /var/www/localhost/htdocs/dokuwiki/inc/parserutils.php(691): Doku_Renderer->plugin()
    22    #4 /var/www/localhost/htdocs/dokuwiki/inc/Ui/PageView.php(56): p_render()
    23    #5 /var/www/localhost/htdocs/dokuwiki/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
    24    #6 /var/www/localhost/htdocs/dokuwiki/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
    25    #7 [internal function]: tpl_content_core()
    26    #8 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(134): call_user_func_array()
    27    #9 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    28    #10 /var/www/localhost/htdocs/dokuwiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    29    #11 /var/www/localhost/htdocs/dokuwiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    30    #12 /var/www/localhost/htdocs/dokuwiki/inc/actions.php(30): include('...')
    31    #13 /var/www/localhost/htdocs/dokuwiki/doku.php(131): act_dispatch()
    32    #14 {main}
    33  2024-08-29 17:02:37     /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(207) E_WARNING: simplexml_load_file():                                 ^
    34    #0 [internal function]: dokuwiki\ErrorHandler::errorHandler()
    35    #1 /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(207): simplexml_load_file()
    36    #2 /var/www/localhost/htdocs/dokuwiki/inc/parser/renderer.php(126): syntax_plugin_svgembed->render()
    37    #3 /var/www/localhost/htdocs/dokuwiki/inc/parserutils.php(691): Doku_Renderer->plugin()
    38    #4 /var/www/localhost/htdocs/dokuwiki/inc/Ui/PageView.php(56): p_render()
    39    #5 /var/www/localhost/htdocs/dokuwiki/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
    40    #6 /var/www/localhost/htdocs/dokuwiki/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
    41    #7 [internal function]: tpl_content_core()
    42    #8 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(134): call_user_func_array()
    43    #9 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    44    #10 /var/www/localhost/htdocs/dokuwiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    45    #11 /var/www/localhost/htdocs/dokuwiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    46    #12 /var/www/localhost/htdocs/dokuwiki/inc/actions.php(30): include('...')
    47    #13 /var/www/localhost/htdocs/dokuwiki/doku.php(131): act_dispatch()
    48    #14 {main}
    49  2024-08-29 17:02:37     /var/www/localhost/htdocs/dokuwiki/lib/plugins/svgembed/syntax.php(211) Error: Call to a member function attributes() on bool
    50    #0 /var/www/localhost/htdocs/dokuwiki/inc/parser/renderer.php(126): syntax_plugin_svgembed->render()
    51    #1 /var/www/localhost/htdocs/dokuwiki/inc/parserutils.php(691): Doku_Renderer->plugin()
    52    #2 /var/www/localhost/htdocs/dokuwiki/inc/Ui/PageView.php(56): p_render()
    53    #3 /var/www/localhost/htdocs/dokuwiki/inc/Action/Preview.php(32): dokuwiki\Ui\PageView->show()
    54    #4 /var/www/localhost/htdocs/dokuwiki/inc/template.php(120): dokuwiki\Action\Preview->tplContent()
    55    #5 [internal function]: tpl_content_core()
    56    #6 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(134): call_user_func_array()
    57    #7 /var/www/localhost/htdocs/dokuwiki/inc/Extension/Event.php(200): dokuwiki\Extension\Event->trigger()
    58    #8 /var/www/localhost/htdocs/dokuwiki/inc/template.php(102): dokuwiki\Extension\Event::createAndTrigger()
    59    #9 /var/www/localhost/htdocs/dokuwiki/lib/tpl/dokuwiki/main.php(60): tpl_content()
    60    #10 /var/www/localhost/htdocs/dokuwiki/inc/actions.php(30): include('...')
    61    #11 /var/www/localhost/htdocs/dokuwiki/doku.php(131): act_dispatch()
    62    #12 {main}
^C
jlpoole@ares ~ $
jlpoolen commented 2 weeks ago

Also, if I "Disable" the plugin, then my playground page renders; however, the SVG file at the end (see below) does not appear and that is the expected behavior since there is no SVG handler within Dokuwiki.

This is the text I'm using as a test in the playground page:

====== SVG Testing ======
{{:playground:sle_airportdiagram_from_nw1_dl20240426-4.svg|}}
restlessminded commented 2 weeks ago

Any way you can attach the .svg file for testing? It appears from the first error that the file isn't parsed because of the 10 MB XML file limit. I want to see if I can take care of that by setting a LIBXML_* flag, but I need something that large to test against.

jlpoolen commented 2 weeks ago

I have staged the SVG file, SLE_AirportDiagram_from_NW1_dl20240426-4.svg, which is 592 Kb at: https://flightmonitor.org/img/SLE_AirportDiagram_from_NW1_dl20240426-4.svg