danyaPostfactum / modx-ckeditor

CKEditor integration into MODx Revolution
19 stars 19 forks source link

Drag and Drop with media resource fails #8

Open pepebe opened 11 years ago

pepebe commented 11 years ago

Im not sure if this problem is caused by my custom media resource snippet or by ckeditor. I'll check on my side, but until I have found an answer here is a brief description of the problem.

Dragging an image from the file tab and dropping it into the ckeditor window results in a malformed url.

This is what I expect: id/0000/000/00/3/adidas.jpg

And this is what I get:

id/0000/000/00/3/id/0000/000/00/3/adidas.jpg

This only happens if a custom media resource includes a dynamic part (e.g. a snippet).

So setting the baseURL to id/0000/000/00/3/ is OK, but creating the baseURL with a snippet results is adding the filepath twice.

basePath andbaseUrl are both relative (yes) and set to [[id2path]].

id2path can be reviewed here: https://gist.github.com/pepebe/6148255

The media resource works with the file tab, image TVs, with modx-ckeditor file browser (with a hacked ckeditor.js) as well as modx normal drag and drop.

Regards,

pepebe.

danyaPostfactum commented 10 years ago

Can you disable CKEditor and see what you get on drag'n'drop into a plain textarea?