Hello,

I've been using this module as part of Panopoly (I just upgraded to Panopoly 1.1), and I'm seeing some unexpected behavior. Basically, if I try to use LinkIt to add a link to an inline image in a WYSIWYG textarea, both the image and adjacent text ends up being part of the link. I've done some research and I'm pretty sure the issue is due to LinkIt. Here's how to reproduce using Panopoly 1.1 (this is the easiest/fastest way to get everything configured to reproduce this issue):

  1. Start with a fresh copy of Panopoly 1.1.
  2. Click to create a new node of type "Content page".
  3. Add some dummy text in the body, and use the "Add media" button to add an inline image (I used "Display as" = "Quarter size"). See http://note.io/OkqlaI
  4. Next, select the image and click the "LinkIt" button and add any valid target path.
  5. After clicking the "Insert link" button, note how _everything_ is now a link. See http://note.io/1goQSLu

This appears to be an issue with the fact that the Media module doesn't output <img> tags, rather it output Media tags (for example: [[{"fid":"8","view_mode":"teaser","fields":{"format":"teaser","field_file_image_alt_text[und][0][value]":"Superman","field_file_image_title_text[und][0][value]":"Superman"},"type":"media","attributes":{"alt":"Superman","title":"Superman","height":"293","width":"240","class":"panopoly-image-quarter media-element file-teaser"}}]]). It appears that LinkIt doesn't properly handle figuring out exactly what is supposed to be linked when a Media tag is selected.

Let me know if I'm on the right track.

Thanks,
-mike

CommentFileSizeAuthor
#6 chrome-ie linkit problem.png127.06 KBneottone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anon’s picture

Status: Active » Closed (cannot reproduce)

When I test this a clean drupal install with the latest media and file_entity, this works.

The media module is converting the media tag in the editor (when in editor mode) to a img tag.

anon’s picture

Status: Closed (cannot reproduce) » Closed (won't fix)

I can also confirm this bug when using Panopoly.

the bug is in Linkit 7.x-2.x

I made a quick update to Linkit 7.x-3.x and that works. Tho is pretty messy to update linkit version in panopoly as they have bundled linkit with there features.

and since this error is fixed on 7.x-3.x, I will not fix this in 2.x id not someone creats a really good patch for it.

jonathanwestman’s picture

Is the update for this in 7.x.3.x-dev? I pulled the latest dev version and this seems to still be an issue. My Linkit tag gets removed when it is wrapping a Media tag.

Any help would be appreciated.

ultimike’s picture

Status: Closed (won't fix) » Active

I think this is still an issue in 7.x-3.x. Here's how to reproduce it in Panopoly 7.x-1.14/LinkIt 7.x-3.2:

  1. Create a new content page with a few paragraphs of text.
  2. Add an image using the "Quarter Size" image style before the first paragraph. Use LinkIt to link the image to somewhere.
  3. Add an image using the "Quarter Size" image style before any of the other paragraphs. Use LinkIt to link the image to somewhere.
  4. See the issue (http://note.io/1z0lqxM).

-mike

anon’s picture

Version: 7.x-2.6 » 7.x-3.x-dev
neottone’s picture

FileSize
127.06 KB

Just to clarify, Linkit works fine on Firefox (v34), but not in IE (v11) or Chrome (v39).

neottone’s picture

aaron.hirtenstein’s picture

Any movement on this? I have run into the same problem, not on panopoly. Using the latest version of Drupal, Media 7.x-2.0-alpha4+11-dev and Linkit 7.x-3.x.

anon’s picture

Try updating to the latest version of the ckeditor lib.

Would be nice if you can post some markup I can use to test this.

anon’s picture

Status: Active » Closed (outdated)

Please, reopen if this is this a problem.