My configuration:
- CKEditor 7.x-1.12 (http://drupal.org/project/ckeditor)
- Linkit 7.x-2.5
- Internet Explorer 10, 9, 8, ...

How to reproduce:
- Select a few words in ckeditor
- Click the linkit icon
- Choose an internal page & click Insert link
- The link is not added around the words we selected
I'm not receiving any kind of error message.

I'm able to insert a link via linkit if I:
- don't select any words, the link is inserted correctly with the node title as link text.
- edit an existing link

I've had a quick look into the code. The javascript code that does the adding of a link is in editors/ckeditor/plugin.js (line 153) ==> style.apply(editor.document); It seems to go wrong here.

Any help appreciated, thx!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

filsterjisah’s picture

Issue summary: View changes

copy

filsterjisah’s picture

Issue summary: View changes

copy

filsterjisah’s picture

At the moment the focus in the dialog window is trigger, the text selection gets lost (IE 10 & below). Could be a limitation in IE?

I think this can be fixed by storing the text selection in a temporary variable (somewhere before putting the focus on the search input field). When submitting / cancelling the dialog window we could reselect the stored text. Any ideas?

The default link plugin seems to work fine, I'll have a look into that.

anon’s picture

Linkit is saving the selection in a temporary variable for just this reason.

filsterjisah’s picture

I just did a fresh drupal install with ckeditor 4:
- when creating a new link by selection of some parts of the text in the editor, I'm still experiencing this error.
- When editing a link, everything works just fine.

@anon, have you tried this in IE?

anon’s picture

Yes I have. Tho It seems like I will have to test it again.

Anonymous’s picture

I'm experiencing the same issue with IE 8/9.

- select text
- press linkit icon; popup opens
- previously selected text is now unselected, visible in the background

Anonymous’s picture

Is there a way I can help with this issue? This seems to me like a "major" bug as it prevents everyone using CKeditor with IE from using the module (which, I guess, affects a lot of "end users"). I tried to debug the JS but I couldn't find any hint as to where the problem could be. My experience with CKeditor's architecture is close to zero, tho. :-( I will have a look at it again, meanwhile I'd be happy to test any patches provided.

anon’s picture

This does work in IE9 on win7!

The link isn't hightlighted after that you have pressed "Insert link" tho, but the link is inserted.

anon’s picture

At the moment the focus in the dialog window is trigger, the text selection gets lost (IE 10 & below). Could be a limitation in IE?

Yes, that is a limitation in IE.

Anonymous’s picture

Did you test with ckeditor version 3 or 4?

anon’s picture

Ckeditor lib 3. (with wysiwyg)

Linkit lacks support for Ckeditor lib 4.

Anonymous’s picture

Ah, that explains. Funny thing is: CKeditor 4 + LinkIt works well in every other browser than IE, even if it is "unsupported". That's why I thought that this must be a bug. I didn't know that version 4 of ckeditor is unsupported. Maybe you should clarify that on the module page.

filsterjisah’s picture

I'm using CKEditor 4 too.
+1 for mentioning on the module page

anon’s picture

Are you using a patched version of wysiwyg?

Anonymous’s picture

Im using http://drupal.org/project/ckeditor (latest stable).

filsterjisah’s picture

Me too, CKEditor 7.x-1.12

anon’s picture

Title: Not working in IE9 and below when making text selection » Insertinbg link not working in IE9 and below when making text selection (with ckeditor 4)

Issue confirmed..

I will see what I can do.

anon’s picture

Status: Closed (fixed) » Needs review
FileSize
1.46 KB

Try this patch..

EDIT: THIS PATCH IS FOR 7.x-3.x

Anonymous’s picture

Title: Insertinbg link not working in IE9 and below when making text selection (with ckeditor 4) » Inserting link not working in IE9 and below when making text selection (with ckeditor 4)
Status: Active » Needs review

Applied cleanly to 2.x-dev, links get inserted correctly in IE8/XP.

Thanks!

anon’s picture

Status: Needs review » Fixed

Patch in #17 commited.

filsterjisah’s picture

I've tested in ff, chrome, safari & ie (8-10) and all works fine.
Thanks!

filsterjisah’s picture

Status: Fixed » Needs work

I think we missed something: you should try the other way now, adding a link without selecting text. This doesn't work anymore.

When pressing the insert button, you'll get redirect to /linkit/dashboard/ckeditor because of the "Drupal.settings.linkit.currentInstance.linkContent is undefined"-error.

Replacing line 18 of the patch:
var content = (Drupal.settings.linkit.currentInstance.linkContent) ? Drupal.settings.linkit.currentInstance.linkContent : data.path;
by
var content = (Drupal.linkitCache.link_tmp_title) ? Drupal.linkitCache.link_tmp_title : data.path;
fixed the problem for me.

anon’s picture

What version are you using??

There is no "Drupal.settings.linkit.currentInstance.linkContent" in 7.x-2.x as I can see.

If you using 7.x-3.x "Drupal.linkitCache.link_tmp_title" doenst exists.

filsterjisah’s picture

I'm using 7.x-2.5.

Indeed, couldn't find Drupal.settings.linkit.currentInstance.linkContent either.
That's why I replaced it back with the original js variable (Drupal.linkitCache.link_tmp_title).

anon’s picture

Status: Needs work » Closed (fixed)

Say what??!?

"Drupal.settings.linkit.currentInstance.linkContent" doesn't exists at all in the code for 7.x-2.x!

How can you then change it??? You must have done something wrong.

Drupal.settings.linkit.currentInstance.linkContent is a new thing for Linkit 7.x-3.x.

Please make sure you have the latest version of Linkit (7.x-2.6 or 7.x-2.x).

anon’s picture

Also, the patch in #17 does NOT apply to 7.x-2.x, its for 7.x-3.x

filsterjisah’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Closed (fixed)

I think there's a misunderstanding here between version 2 & 3. The issue I reported was for version 2. Since the patch was written for version 3, there was still something wrong with it when I applied it to my project (version 7.x-2.5). I did change the code in your patch, not in the linkit original code.

7.x-2.6 looks the same as applying the patch to 7.x-2.5, so an upgrade would fix the problem too :)

Thanks a lot for your great module.

dieterlwrs’s picture

Don't know if I can post it here, but is there a fix available for the D6 version of this module?

dieterlwrs’s picture

Issue summary: View changes

also not working in IE10