jakob1111 / dokuwiki-plugin-flowcharts

Add flowcharts and diagrams to Dokuwiki with an incredibly simple syntax
GNU General Public License v2.0
7 stars 8 forks source link

Plugin not initializing #15

Closed issmirnov closed 3 years ago

issmirnov commented 4 years ago

Hey there,

I installed this plugin on the latest RC of Dokuwiki (Hogfather).

I created a sample page:

<flow>
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;    
click A "SOMEPAGE"
</flow>

The page does not render.

Screen Shot 2020-06-18 at 4 12 01 PM

Console logs show:

mermaid-init.js:1 Uncaught ReferenceError: mermaidAPI is not defined
    at mermaid-init.js:1

I can confirm that /plugins/flowcharts/mermaid.min.js exists and is loading:

Screen Shot 2020-06-18 at 4 11 06 PM

Can you help debug? Happy to post more logs, etc.

issmirnov commented 4 years ago

I edited the mermaid-init.js to call mermaid.mermaidAPI.initialize. This solves the JS issue seen in console. However, after checking server side logs:

2020/06/18 16:17:52 [error] 11182#11182: *11320231 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'Doku_Parser_Mode_internallink' not found in /var/www/example.wiki/lib/plugins/flowcharts/syntax.php:98
Stack trace:
#0 /var/www/example.wiki/lib/plugins/flowcharts/syntax.php(72): syntax_plugin_flowcharts->p_get_instructions()
#1 /var/www/example.wiki/inc/parser/renderer.php(117): syntax_plugin_flowcharts->render()
#2 /var/www/example.wiki/inc/parserutils.php(673): Doku_Renderer->plugin()
#3 /var/www/example.wiki/inc/parserutils.php(142): p_render()
#4 /var/www/example.wiki/inc/parserutils.php(89): p_cached_output()
#5 /var/www/example.wiki/inc/html.php(305): p_wiki_xhtml()
#6 /var/www/example.wiki/inc/Action/Show.php(33): html_show()
#7 /var/www/example.wiki/inc/template.php(99): dokuwiki\Action\Show->tplContent()
#8 [internal function]: tpl_content_core()
#9 /var/www/example.wiki/inc/Extension/Event.php(129): call_user_func_array()
#10 /var/www/example.wiki/inc/Extension/Event.php(195): dokuwiki\Ext" while reading response header from upstream

Seems there's an issue with Doku_Parser_Mode_internallink caused by https://github.com/jakob1111/dokuwiki-plugin-flowcharts/blob/master/syntax.php#L72?

pltcldvlpr commented 3 years ago

Same here, using version 0.1 doesn't work either in current dokuwiki version.

issmirnov commented 3 years ago

Paging @jakob1111

ddchrist commented 3 years ago

@issmirnov, I purpose an issue close as my rendering problem stopped with installing latest commit on my Hogfather dokuwiki.

issmirnov commented 3 years ago

Confirmed, just tested and this works. Thank you for flagging.

Screen Shot 2021-02-25 at 11 27 26 AM