mgeb / mediawiki-drawio-editor

MediaWiki extension that integrates the draw.io flow chart editor.
MIT License
20 stars 21 forks source link

No edit button, and link displayed in editor on adding a drawio diagram #14

Open davethehat opened 5 years ago

davethehat commented 5 years ago

I have an empty page with a single test diagram: {{#drawio:TestDiagram2}}

Displaying the page shows a placeholder saying simply:

TestDiagram2 empty draw.io chart

No drawio edit button is present. When I load the visual editor I see a template section for the drawio content, and then a link as follows:

TestDiagram2 empty draw.io chart

<a id='drawio-img-href-1915653392' href=''><img id='drawio-img-1915653392' src='' title='drawio: TestDiagram2' alt='drawio: TestDiagram2' style='height: auto; width: 100%; max-width: 0; display:none;' /></img></a>

I'm running mediawiki in docker, and have visual editor, code syntax highlighting and SVG support enabled:

MediaWiki | 1.31.1 PHP | 7.1.25 (apache2handler) MariaDB | 10.1.37-MariaDB ICU | 57.1

VisualEditor | 0.1.0 (6854ea0)22:33, 5 November 2018 | MIT | Visual editor for MediaWiki | Alex Monk, Bartosz Dziewoński, Christian Williams, David Lynch, Ed Sanders, Inez Korczyński, James D. Forrester, Moriel Schottlender, Roan Kattouw, Rob Moen, Timo Tijhof, Trevor Parscal, C. Scott Ananian and others DrawioEditor | 1.0 |   | draw.io flow chart creation and inline editing | Markus Gebert SyntaxHighlight | 2.0 | GPL-2.0-or-later | Provides syntax highlighting  using Pygments - Python syntax highlighter | Brion Vibber, Tim Starling, Rob Church, Niklas Laxström, Ori Livneh and Ed Sanders NativeSvgHandler | 1.2 |   | Serves SVG images directly to clients | Povilas Kanapickas, Ilaï Deutel

Any thoughts as to what might be happening?

davethehat commented 5 years ago

OK - so this is down to the drawio extension and VisualEditor not playing nicely together. It would be awesome if they did: are there any plans to work on this?

kaijauk commented 4 years ago

Well, I have the same problem now, using mediawiki 1.33.1 - someone now how to fix this? :)

davethehat commented 4 years ago

in our environment this seemed to be down to whether the user was logged in or not. If logged in, Visual Editor and drawio worked nicely for us.

polymathuk commented 3 years ago

I have the same problem so I can't use the extension at all. With no edit button how can the editor be invoked?

Mediawiki 1.35 PHP 7.3 MariaDB 10

tuxedo0801 commented 3 years ago

Same issue here. It worked for months. Now I can only see my already created images/drawings, but there's no edit button any more :-( Any help?!

tuxedo0801 commented 3 years ago

Tried to debug this a bit. Seems that the DrawIO JS is not loaded at all?!

LocalSettings.php still contains:

require_once "$IP/extensions/DrawioEditor/DrawioEditor.php";

is this no longer sufficient or what?

[update]

The only thing that has changed in last months: PHP Version and switch from MySQL to Maria DB.

Still using MW 1.30.0 and DrawIO Extension 1.0 ...

Updating to DrawIO Extension 1.1 - see download from https://www.mediawiki.org/wiki/Extension:DrawioEditor did not solve it (caused more problems), also using the github latest version also did not help

tuxedo0801 commented 3 years ago

Found out it relates to

        /* check for conditions that should or will prevent an edit of the chart */
        $readonly = (!$wgEnableUploads
            || (!$img && !$wgUser->isAllowed('upload'))
            || ($img && !$wgUser->isAllowed('reupload'))
            || $parser->getTitle()->isProtected('edit')
            );

Looks like one of the conditions tends to false which let readonly be true ... will further investigate.

[update] oh, damn... found the issue. I protected the page to "admin only", that caused the edit-button to disappear.

gripfastistech commented 3 years ago

oh, damn... found the issue. I protected the page to "admin only", that caused the edit-button to disappear.

I also experienced the "no edit button" but my user guide was on a locked admin only page.

After removing the admin lock, the extension works (mediawiki 1.27) and I have visual editor installed also.

Marking the page with draw.io extension admin-only-move doesn't effect it. Working, thanks @tuxedo0801!