Forum closed. New forum available at http://community.wymeditor.org/

Image paths being altered (bug?)

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

Image paths being altered (bug?)

Postby mcfang on Tue Feb 13, 2007 5:46 am

In the process of testing WMYeditor in a CMS system I noticed that it seems to rewrite image paths if you do not use a full URL.

An example follows:
1) Editor is loaded from some path "/base/admin/editor"
2) Insert image with path "/base/img/image.jpg"
At this point the image is inserted correctly and all is fine.
3) Drag and drop the image to another position in the editor
Now when we inspect the sourcecode the image path has changed to "../img/image.jpg". The path is now relative, and will break if we attempt to view the output from another hierarchy.
mcfang
 
Posts: 4
Joined: Tue Feb 13, 2007 5:36 am

Postby jfh on Tue Feb 13, 2007 3:25 pm

This issue is discussed here: http://trac.wymeditor.org/trac/wiki/AbsoluteURLs

HTH,
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Re: Image paths being altered (bug?)

Postby jonasvp2 on Tue Jan 20, 2009 11:21 am

Ok, I'm aware that this thread is about two years old but I ran into the same problem. The solution on the Wiki page does not help me as my users often insert an image and then move it right away, without saving first. This turns the absolute URLs from inserting the image into a relative URL without me being able to change it in my server-side code.

Why does this happen at all? If you can point me to the general area of the Wymeditor code where the moving happens, I'd be glad to try and have a look at it.

Cheers,

Jonas
jonasvp2
 
Posts: 2
Joined: Tue Jan 20, 2009 11:18 am

Re: Image paths being altered (bug?)

Postby eadevel on Fri Jan 23, 2009 10:09 am

I had the same problem and spent countless hours trying to figure it out.

Bottom line the jQuery framework uses innerHTML in the function html("htmlcode") that's used in wymeditor and IE (doesn't happen in Firefox 3) changes relative paths to absolute paths on-the-fly.

Try looking at this place:
http://webbugtrack.blogspot.com/search/label/innerHTML

There's a patch in http://dev.rubyonrails.org/ticket/11350 that you could try to import.. I tried and failed but you could be successful! :wink:
eadevel
 
Posts: 22
Joined: Thu Sep 27, 2007 12:00 pm

Re: Image paths being altered (bug?)

Postby jonasvp2 on Fri Jan 23, 2009 10:31 am

Glad to hear I'm not the only one with this problem. My users are getting pretty annoyed here... :-(

I'm assuming that it's some weird browser-related thing. Thanks for you pointers, interestingly enough I have the problem in Firefox 3 and it's changing absolute paths to relative ones, not the other way around. And I'm not sure how that patch applies to Wymeditor since it refers to Prototype.

I'll try to start digging in the code, maybe something will turn up.

Cheers,

Jonas
jonasvp2
 
Posts: 2
Joined: Tue Jan 20, 2009 11:18 am

Re: Image paths being altered (bug?)

Postby eadevel on Wed Jan 28, 2009 4:08 pm

I know it's prototype. The solution should be in jquery core but see the "bug" http://dev.jquery.com/ticket/1029.

Try looking at the following:
http://www.stevetucker.co.uk/page-innerxhtml.php
http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
http://forums.devarticles.com/javascript-development-22/wysiwyg-editor-innerhtml-makes-all-links-absolute-4222.html

This was what I researched on the time, haven't had the time to do some more testing. If you achieve something please let me know! It would be great to get relative paths working..
eadevel
 
Posts: 22
Joined: Thu Sep 27, 2007 12:00 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 5 guests