If there is an image inserted in one place in the content with the path:

src="/sites/default/files/image.jpg"

and you then ctrl-x -> ctrl-v to cut and paste it into a different place,
or click and drag it (firefox), the path becomes corrupted to:

src="../../../../../default/files/image.jpg"
and so the image does not display when viewed.

Anyone know what would cause this strange behaviour? It could be confusing for users who place and image and then decide to move it.

I seem to remember moving images around three months ago without any problems. Of course, drupal, firefox, fckeditor, and the fckeditor module have all been updated since then, so I'm totally lost as to the cause of this. Can anyone even replicate it?

Thanks.

Comments

-Anti-’s picture

OK, I am able to easily replicate the issue at: http://www.fckeditor.net/demo

So I guess it is something which has crept into either firefox 3.x or fckeditor.
I'd take this issue up on the fckeditor.net forum, but 90% of the threads there go unresolved.

Does anyone have *any* idea as to what the problem might be? Or a solution?
The nearest I could find was this: http://dev.fckeditor.net/ticket/1847

http://dev.fckeditor.net/ticket/193
and
http://www.fckeditor.net/forums/viewtopic.php?f=6&t=12409&p=32598
may be related to the problem.

Cheers.

Steve Dondley’s picture

I'm seeing the same thing. But only on my drupal 5 site using 5.x-1. On my d6 site using 6.x-2, everything is fine.

-Anti-’s picture

Thanks for your reply.

> On my d6 site using 6.x-2, everything is fine.

Are you using FF3 on a PC?

> 6.x-2

Sorry, is that a drupal version or the fckeditor module version?

Also, if anyone else has any ideas or info, I'd love to hear it.
This is quite a critical issue if you're using a wysiwyg editor.

Is there even a way to disable the 'drag and drop' and 'resize'?

cheers

Steve Dondley’s picture

Yes, using ff3. The 6.x-2 version of fckeditor module works fine on d6. The 5.x-1 version of fckeditor module has the problem with moving images around. They are both using the same version of fckeditor (downloaded from the fckeditor site).

-Anti-’s picture

> The 6.x-2 version of fckeditor module works fine on d6

Sorry, I'm a noob.
Which is better to use: 6.x-2.0-alpha4 or 6.x-2.x-dev ?
Are you using it on a production site?

I'm sure this bug wasn't around 3 months ago!
Does all this point to some fckeditor versions being the main problem?
Maybe they didn't work when FF3 was introduced, but have been fixed in the latest releases?

Cheers

bsimon’s picture

I also get this bug with 6.x-1.3-rc6.

I'm using IMCE. When IMCE inserts the images, they work, but if I drag them to a new position with FCKeditor, the link breaks. The images will still show inside the FCKeditor panel, but not when the page is viewed normally. (I originally assumed this was happening because I hadn't set FCKeditor's 'Path to uploaded files' correctly - but I guess that's not the problem).

-Anti-’s picture

The thing is, you can go here and easily replicate the issue: http://www.fckeditor.net/demo

And that demo site has NOTHING to do with drupal, IMCE or the fckeditor module.
So this *must* be an issue with the fckeditor itself and FF3??
Which is bad news because nothing in fckeditor *ever* gets fixed quickly.

bsimon’s picture

If I use Google Chrome instead of FF3, there's still a problem, but the effect is different. When I move an image inside FCKeditor, the image path changes from a relative to absolute path (i.e. it includes www.example.com).

However, I don't get any problems at http://www.fckeditor.net/demo with FF3 or GC - the demo appears to work OK for me.

(BTW, -Anti-, I wasn't disagreeing with you or trying to start a debate - just reporting what I've seen, in case the extra information gives a clue that will help someone figure this out).

-Anti-’s picture

> However, I don't get any problems at http://www.fckeditor.net/demo

Very weird... I was able to replicate the problem on the fckeditor demo site a few days ago, and now not!
Maybe that points to some javascript being cached in my browser, going from the drupal site to the fck demo site?

This is such an annoying development!

I'll try the alpha version of fckeditor module on a test site tomorrow and see if that affects anything.

bsimon’s picture

If this can't be fixed then a possible workaround for this might be some code to do an automatic replacement whenever an FCKeditor form is submitted.

Maybe just replacing src="../../../../../default/files/ with src="/sites/default/files/ is enough. It's a terrible hack, but it seems like nothing could go wrong as that path is never going to occur normally

There are at least two modules that replace strings (String Overrides and Search and Replace), but I don't think either of them will touch HTML. But it seems like the code to do this replacement just for this single special case would actually be very simple. It's mainly a question of where to put it.

edit: looks like this kind of workaround is what phpwebber is trying to do, but can't quite get it working right yet - http://www.fckeditor.net/forums/viewtopic.php?f=6&t=12409&p=32598

edit: and the cause may actually be a very old bug in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=417199), although Google Chrome also seems to have a similar problem.

also it looks like maybe FCkeditor already has a workaround for this bug: _fcksavedurl ?

bsimon’s picture

I'm seeing the same thing. But only on my drupal 5 site using 5.x-1. On my d6 site using 6.x-2, everything is fine.

The strangest thing is, I see this issue on a Drupal 6 site (FCkeditor 6.x-1.3-rc6), but not on an old Drupal 5 install (5.x-1.1) ;/

-Anti-’s picture

> The strangest thing is, I see this issue on a Drupal 6 site (FCkeditor 6.x-1.3-rc6),
> but not on an old Drupal 5 install (5.x-1.1)

Right, so we know FF3 has the bug under certain circumstances, and it's a very old bug.

1)
Do we know for a fact that this bug wasn't there in D6 a few weeks ago?
I never came across it when I was testing fckeditor during the summer.

2)
If it wasn't there a few weeks ago, then we need to find out whether it is the upgrade
to FCkeditor 6.x-1.3-rc6 (module) OR the upgrade to FCKeditor 2.6.3 which is
causing this.

I don't know how to adequately test this. Especially with regard to things being cached
in the browser or website; I have no idea how to ensure I'd be testing the rolled-back
script(s) rather than script that was cached.

dirtabulous’s picture

We came across this awhile ago, but the first time I looked into the issue.

When using FF3, the ../../../../ problem comes up.
This seems to work as desired using IE7.

Was trying:
version 6.x-2.x-dev from Nov w/ FCKEditor 2.6.3.

Just tried upgrading to see if it would fix:
version 6.x-2.0-alpha4, w/ FCKEditor nightly build (2009-01-13)

bsimon’s picture

Just tried upgrading to see if it would fix:
version 6.x-2.0-alpha4, w/ FCKEditor nightly build (2009-01-13)

Did upgrading to 2.0-alpha4 fix it?

wwalc’s picture

Category: support » bug

Confirmed (more or less) @ FF2/FF3 / latest dev release of the FCKeditor module 6.x-1.x... but *not on the demo site*.

-Anti- in his #1 comment found all related tickets to this bug.
bsimon is also correct with his assumptions that there is a workaround for this bug (_fcksavedurl) which apparently is somehow broken by the FCKeditor module... and the bug report on the mozilla site (417199) was actually created by Martin Kou, FCKeditor developer ;)

I'll check now various combinations of older releases to see when and why did that happen... I'll report my findings soon.

wwalc’s picture

Status: Active » Fixed

Fixed in CVS. Thanks for your help in tracking this issue down.
The dev release should be available in around two hours. Remember to clear browser's cache after upgrading.

It turned out that FCKeditor module broke the _fcksavedurl workaround in the imageassist plugin.
This plugin is enabled by default and it did execute too much code even if Image Assist was disabled.

-Anti-’s picture

Status: Fixed » Active

That's wonderful!
Thank you so much for looking into this issue.
The best I can do is run around like a headless chicken.
Which isn't usually much help.

EDIT:
Tested today - seems to have fixed all issues without introducing any quirks.
I thought this was going to be a really big problem for my users to deal with.
Thanks!

bsimon’s picture

Thanks, look forward to trying it out (guess status should be set to fixed for now :)

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

arnieswap’s picture

Facing same issue here.