mikitex70 / redmine_drawio

Macro plugin to embed draw.io diagrams into Redmine wiki pages
MIT License
125 stars 51 forks source link

Error while saving the diagram to DMSF with project names enabled in WebDAV #32

Closed dinya closed 6 years ago

dinya commented 7 years ago

If I enable

dmsf_webdav_pjc_names

then redmine_drawio raises exception:

Error saving diagram:
Make sure the DMSF folder exists and is accessible

Redmine installation

Environment:
  Redmine version                3.3.1.stable
  Ruby version                   2.2.3-p173 (2015-08-18) [x86_64-linux]
  Rails version                  4.2.7.1
  Environment                    production
  Database adapter               Mysql2

with

  redmine_dmsf                   1.5.9
  redmine_drawio                 0.6.0
dinya commented 7 years ago

It's ok now. I use dmsf from master branch (1.5.9) and redmine_drawio from develop branch

dinya commented 6 years ago

@mikitex70

I have the same problem with redmine_dmsf v1.6.1 (current master @ 2018-04-20) and redmine_drawio v0.8.1 (current master @ 2018-04-20).

I think https://github.com/mikitex70/redmine_drawio/blob/master/lib/redmine_drawio/macros.rb#L242

saveName = "#{project.name} -#{project.id}-/#{diagramName}"

should be

 saveName = "#{project.name} #{project.id}/#{diagramName}"

(without - for project ID).

Maybe redmine_drawio should check redmine_dmsf version to save backward compatibility.

mikitex70 commented 6 years ago

I've fixed the code in the develop branch. I've checked the path syntax in the DMSF sources, it seems to work but I've noted strange behaviours in the DMSF webdav if projects names contains spaces and the Use project name for project folder option is set (unable to save, webdav directory non coherent with projects, ...). If the webdav is really broken I cannot be sure to be able to save the diagrams. Git it a try, if possible using projects with and without spaces, and with and without the previous mentioned DMSF flag. Try also to navigate to http://your-redmine/dmsf/webdav and check the directory listing.

dinya commented 6 years ago

I've checked the path syntax in the DMSF sources, it seems to work but I've noted strange behaviours in the DMSF webdav if projects names contains spaces and the Use project name for project folder option is set (unable to save, webdav directory non coherent with projects, ...). If the webdav is really broken I cannot be sure to be able to save the diagrams.

I confirm the problem. With this checkbox activated and whitespaces in the project name the saving is not working.

Maybe report the issue to DMSF project?

mikitex70 commented 6 years ago

I've open the issue danmunn/redmine_dmsf#851. In the meantime I keep this issue open for some more time, to be able to confirm that all is working fine.

mikitex70 commented 6 years ago

Fix released in version v0.8.2, closing issue. For to get all working we must wait the DMSF fix.