using WYSIWYG module + CKeditor 4.1 links vanish when editting a node.

to replicate

install:
WYSIWYG module dev (2013-Apr-12)
CKeditor 4.1 (Full package)

Create a piece of content, add text, add a link. Save the page. (content-screenshot1.png)
Edit the content and note the links are gone. (content-edit-screenshot1.png)

Workaround

Enable the default ckeditor 'link' button for the text format.

Comments

anon’s picture

What browers and version is this?

silkogelman’s picture

I tested with
Safari 6.0.2 (8536.26.17)
Firefox 20.0
Chrome 26.0.1410.43

sander wemagine’s picture

I'm having the same issue.

The HTML:

<a href="internal:node/74">linktext</a>

still appears but it seems like it get filtered/stripped by a CKeditor filter once CKeditor is loaded. I've tried setting different security filters but having no luck.

sander wemagine’s picture

I have 'fixed' this problem by using a similar module: http://drupal.org/project/ckeditor_link

realityloop’s picture

Status: Active » Closed (cannot reproduce)

unable to reproduce this, it was probably your input filter

jeni_dc’s picture

Just to clarify this a bit, I ended up here because I saw the same behaviour using CKEditor 7.x-1.13 and Linkit 7.x-2.6. Links would be saved in content, and then disappear in the editor when editing.

I traced this back to the fact that I had the linkit button enabled for CKEditor, but I did not have the standard link buttons enabled. When enabling both the linkit button and the standard link/unlink buttons, the links remained.

So it looks like for this to work properly with CKEditor both the linkit and standard link buttons need to be enabled.

Anonymous’s picture

Status: Closed (cannot reproduce) » Active

This is due to Ckeditor 4.1+ "Advanced Content Filter". In short, plugins now need to tell ckeditor which objects, attributes and parameters to allow. Everything not explicitly allowed is being stripped on loading the editor/copy and pasting content.

Read more here:

http://ckeditor.com/blog/Integrating-Plugins-with-Advanced-Content-Filter
http://docs.ckeditor.com/#!/guide/plugin_sdk_integration_with_acf

changing

      // Add Command.
      editor.addCommand( 'linkit', {
          exec : function () {

to

      // Add Command.
      editor.addCommand( 'linkit', {
          allowedContent: 'a[title,href,style]',
          exec : function () {

is a temporary fix to get things going.

The new "link" plugin has a lot of references to "allowedContent" - this might require some larger refactoring. I don't know about the backwards compatibility issues tho.

https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/link/plugin.js

Changing status back to "active" because it is in fact reproduceable. :-)

anon’s picture

Title: Links disappearing on node edit » Links disappearing on node edit (ACF problem)
Status: Active » Fixed

Fixed pushed to both 7.x-3.x and 7.x-2.x

WebSinPat’s picture

The patch from #7 seems to work for me. Hopefully that is all it takes.

Status: Fixed » Closed (fixed)

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