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!
Comment | File | Size | Author |
---|---|---|---|
#17 | 1915086-17.patch | 1.46 KB | anon |
#1 | ie9-loses-text-selection-modal-focus.jpg | 135.46 KB | filsterjisah |
Comments
Comment #0.0
filsterjisah CreditAttribution: filsterjisah commentedcopy
Comment #0.1
filsterjisah CreditAttribution: filsterjisah commentedcopy
Comment #1
filsterjisah CreditAttribution: filsterjisah commentedAt 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.
Comment #2
anonLinkit is saving the selection in a temporary variable for just this reason.
Comment #3
filsterjisah CreditAttribution: filsterjisah commentedI 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?
Comment #4
anonYes I have. Tho It seems like I will have to test it again.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedI'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
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedIs 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.
Comment #7
anonThis does work in IE9 on win7!
The link isn't hightlighted after that you have pressed "Insert link" tho, but the link is inserted.
Comment #8
anonYes, that is a limitation in IE.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedDid you test with ckeditor version 3 or 4?
Comment #10
anonCkeditor lib 3. (with wysiwyg)
Linkit lacks support for Ckeditor lib 4.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAh, 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.
Comment #12
filsterjisah CreditAttribution: filsterjisah commentedI'm using CKEditor 4 too.
+1 for mentioning on the module page
Comment #13
anonAre you using a patched version of wysiwyg?
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedIm using http://drupal.org/project/ckeditor (latest stable).
Comment #15
filsterjisah CreditAttribution: filsterjisah commentedMe too, CKEditor 7.x-1.12
Comment #16
anonIssue confirmed..
I will see what I can do.
Comment #17
anonTry this patch..
EDIT: THIS PATCH IS FOR 7.x-3.x
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedApplied cleanly to 2.x-dev, links get inserted correctly in IE8/XP.
Thanks!
Comment #19
anonPatch in #17 commited.
Comment #20
filsterjisah CreditAttribution: filsterjisah commentedI've tested in ff, chrome, safari & ie (8-10) and all works fine.
Thanks!
Comment #21
filsterjisah CreditAttribution: filsterjisah commentedI 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.
Comment #22
anonWhat 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.
Comment #23
filsterjisah CreditAttribution: filsterjisah commentedI'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).
Comment #24
anonSay 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).
Comment #25
anonAlso, the patch in #17 does NOT apply to 7.x-2.x, its for 7.x-3.x
Comment #26
filsterjisah CreditAttribution: filsterjisah commentedI 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.
Comment #27
dieterlwrs CreditAttribution: dieterlwrs commentedDon't know if I can post it here, but is there a fix available for the D6 version of this module?
Comment #27.0
dieterlwrs CreditAttribution: dieterlwrs commentedalso not working in IE10