Jump to content

Extension talk:Flex Diagrams

Add topic
From mediawiki.org
Latest comment: 11 months ago by Squeak24 in topic Transcluding Diagrams

Internal error after creating a diagram under Drawio

[edit]

(MW 1.40.0, installed the extension from git clone)

[af1da6cc969dcde9d3fd12d3] /index.php/Mermaid:Demo?debug=true TypeError: FDHooks::displayIncomingLinks(): Argument #4 ($output) must be of type MediaWiki\Output\OutputPage, OutputPage given, called in /var/www/html/includes/HookContainer/HookContainer.php on line 338

Backtrace:

from /var/www/html/extensions/FlexDiagrams/FDHooks.php(77)

#0 /var/www/html/includes/HookContainer/HookContainer.php(338): FDHooks::displayIncomingLinks(MediaWiki\Revision\RevisionStoreCacheRecord, MediaWiki\Title\Title, integer, OutputPage)

#1 /var/www/html/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)

#2 /var/www/html/includes/HookContainer/HookRunner.php(809): MediaWiki\HookContainer\HookContainer->run(string, array)

#3 /var/www/html/includes/page/Article.php(702): MediaWiki\HookContainer\HookRunner->onArticleRevisionViewCustom(MediaWiki\Revision\RevisionStoreCacheRecord, MediaWiki\Title\Title, integer, OutputPage)

#4 /var/www/html/includes/page/Article.php(545): Article->generateContentOutput(User, ParserOptions, integer, OutputPage, array)

#5 /var/www/html/includes/actions/ViewAction.php(78): Article->view()

#6 /var/www/html/includes/MediaWiki.php(556): ViewAction->show()

#7 /var/www/html/includes/MediaWiki.php(333): MediaWiki->performAction(Article, MediaWiki\Title\Title)

#8 /var/www/html/includes/MediaWiki.php(923): MediaWiki->performRequest()

#9 /var/www/html/includes/MediaWiki.php(576): MediaWiki->main()

#10 /var/www/html/index.php(50): MediaWiki->run()

#11 /var/www/html/index.php(46): wfIndexMain()

#12 {main} Ittaydr (talk) 11:49, 28 January 2025 (UTC)Reply

Thanks for letting me know about that, and sorry about the problem. I just checked in what I think is a fix for this - if you get the latest code, hopefully it will work.
By the way, thanks for putting in all that work to get the error message to display correctly! If you have to do it again, though, I think you can just wrap the whole thing in a <pre> tag - that should be quite a bit easier. Yaron Koren (talk) 17:09, 28 January 2025 (UTC)Reply
Yes, it works. Note I didn't put any work to get the error message to display correctly. Ittaydr (talk) 07:09, 29 January 2025 (UTC)Reply
Oh, okay - I guess that was VisualEditor being clever. Good to hear. Yaron Koren (talk) 20:46, 29 January 2025 (UTC)Reply

It is awkward to use the extension in VisualEditor

[edit]

If I start typing {{, a dialog box jumps asking me to put in the template. It doesn't accept the '#'. I can type the string someplace else and paste, but that's very awkward. Using the raw source editor is not suitable for some users (and also awkward to switch just for it) Ittaydr (talk) 07:15, 29 January 2025 (UTC)Reply

Is this a comment about Flex Diagrams, or just about this talk page? Yaron Koren (talk) 20:47, 29 January 2025 (UTC)Reply
about the extension. I later realized VE doesn't support parser functions. Maybe there's an alternative (tags?) Ittaydr (talk) 21:30, 29 January 2025 (UTC)Reply
I don't know, but many extensions define parser functions - Flex Diagrams is hardly the only one. If typing out a parser function is a problem for you or other users, you could always create a template that wraps around #display_diagram. (And that way the dialog box would be useful.) Yaron Koren (talk) 22:24, 29 January 2025 (UTC)Reply

Transcluding Diagrams

[edit]

Hi,

Is it possible to transclude a diagram into another page? I have a number of BPMN diagrams that I want to include in the relevant pages, but it comes back saying that the diagrams can't be displayed.

Any help is appreciated. Squeak24 (talk) 14:15, 9 July 2025 (UTC)Reply

Did you try calling #display_diagram? Yaron Koren (talk) 14:55, 9 July 2025 (UTC)Reply
Thanks Yaron, I'll try that. Squeak24 (talk) 13:46, 1 August 2025 (UTC)Reply