Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't save my diagrams #1

Open
pierrickrouxel opened this issue Nov 18, 2015 · 15 comments
Open

I can't save my diagrams #1

pierrickrouxel opened this issue Nov 18, 2015 · 15 comments

Comments

@pierrickrouxel
Copy link

Hi,

I have a problem saving my graph. Draw.io say wait on "saving..." and does nothing.

Can you help me?

This extension is awesome! Thank you for your job.

@yohtm
Copy link

yohtm commented Dec 3, 2015

I have the same problem.

I also intially had trouble accessing pre-made diagrams but it ended up working by uploading a file name like the following: Drawio_[Filename].xml

By the way thanks for the extension, I've been thinking/wanting of doing something similar for months!

@crest55
Copy link

crest55 commented Dec 7, 2015

I also have this problem,

@yohtm, could I ask you what do you mean of "uploading a file name like the following: Drawio_[Filename].xml"

@yohtm
Copy link

yohtm commented Dec 14, 2015

@crest55, basically I created a diagram on DrawIO, downloaded it, gave the name "Drawio_Test.xml" to my file and then uploaded it to my Wiki. Then, in the page editor, I used "{{#drawio:Test}}". That allowed me to have my pre-existing diagram accessible on the wiki. I still can't see the preview or save it though.

@crest55
Copy link

crest55 commented Dec 19, 2015

Thank you @yohtm, I understand now.

@tosher
Copy link

tosher commented Jan 24, 2016

In current version tmp dir is defined like:

$tmp_name = $_SERVER["DOCUMENT_ROOT"] . "/tmp/tmp_".rand(0,1000).rand(0,1000).".".$ext;

If this path is not available and not writable for wiki engine, we have an error with uploading data to wiki.
Version in pull request using tmp dir based on $wgTmpDirectory variable, for example (LocalSettings.php):

$wgTmpDirectory = "$IP/images/tmp/";

Another problem (for notes or doc..)

For correct generation of drawio images in PDF with mwlib library, the easy way is creation of template like DrawIO

<div class="noprint">
{{#drawio:{{{img}}}}}
</div>

<div class="onlyinprint">
[[Image:Drawio_{{{img}}}.png]]
</div>

Then we can use:

{{DrawIO|img=testup}}
  • For browser: showing image and edit link
  • For PDF generation - correct wiki image link

@SeregaPru
Copy link

Thank you, tosher.

I commited some modificstions from your pull request accourding tmp dir.

If you still have errors, you can see and modify function
function getUploadDirectory() {
global $wgUploadDirectory;
return $wgUploadDirectory;
}
in Drawio.body.php

@yohtm
Copy link

yohtm commented Jan 25, 2016

Thanks for the updates guys. I still have a problem saving (and therefore displaying) the diagrams. I get 400 bad request reply (see below). Not sure if it's related to the cross-domain iframe, to the ues of https or something else (the editor does appear and I am able to change my diagram). Any ideas?

save-diag-error-1

@tosher
Copy link

tosher commented Jan 25, 2016

Because of we have two versions now.. I have a question :)
With version from my fork and defined $wgTmpDirectory variable - the same error?

@yohtm
Copy link

yohtm commented Jan 25, 2016

Oh I didn't read it right I thought the branch was merged. It actually works on your branch. Thanks!

@lexsulzer
Copy link

Hi guys!

First of all many kudos for launching this extension! Draw.io is fantastic and semi-integrating it into MW is of course a bliss. I am eager to help to make this extension stable and robust.

That said, here are some observations. I am investigating, but thought it would be helpful to let you know up front:

  • I have tried both @SeregaPru's master and @tosher's fork on MW 1.23.11 and 1.26.2 in Chrome, Firefox and Opera.
  • Upon saving a drawing I get a POST http://localhost:20091/main/Special:Drawio 500 (Internal Server Error) in the browser and a corresponding PHP Fatal error: Call to a member function load() on a non-object in /var/www/html/m/includes/upload/UploadBase.php on line 698 on the server.
  • Upon reloading the page, the .png version of the drawing is actually displayed on the page, but:
  • upon clicking "edit", the drawing is not reloaded for edit, but a blank draw.io canvas is shown, and
  • a click on the .png is taking me to http://localhost:20091/index.php/Image:Drawio_hapa%20flowchart%209.png instead of http://localhost:20091/m/index.php/Image:Drawio_hapa%20flowchart%209.png (wgScriptPath is not included)

What do you think? How should we proceed?

@SeregaPru
Copy link

Hello.
I think this is the main reason of error - that your MediaWiki is located not in root folder of site.
We have not tested this extension in this case.
If you can, try to move wiki to root folder.

If not - just wait. We need some days to reproduce this case and (I hope) fix it.

@lexsulzer
Copy link

Hi

Ok. Great! I'll dedicate today's afternoon to this. Please note that running an MW in site root is not recommended. (https://www.mediawiki.org/wiki/Manual:Wiki_in_site_root_directory, you probably know this link already)

Regards and many thanks for your quick answer!

@lexsulzer
Copy link

Hi

Ok. Solved the issues.

About clicking .pngs on wikis not installed in site root:

Drawio.php's line 170 (as filed on Feb 17, 2016 1546 CET)

$output .= '<a href="/index.php/Image:' . $image_name.'">';

should be changed to

$output .= '<a href="'.$wgScriptPath.'/index.php/Image:' . $image_name.'">';

About my experienced save and reload problems

I had xml set as a forbidden file type.

Regards and let me know if I can contribute more.

@SeregaPru
Copy link

Thank you for quick fix!
On the days we will try this case, check if will be working ir toor and non-root folders,
and commit fixes.

Description will be corrected about enablixg XML type

@esvorontsov
Copy link
Contributor

Error when MediaWiki is located not in root folder of site fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants