Closed (fixed)
Project:
Editor Advanced link
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2016 at 11:54 UTC
Updated:
3 Oct 2016 at 14:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sashken2 commentedComment #3
duaelfrCould you try without Linkit to see if it's related or if it's an issue of Editor Advanced Link ?
I did something special to be able to remove the target attribute when unchecked so I suppose there is a problem within Linkit but I'd like to be sure.
Comment #4
sashken2 commentedUninstall Linkit. Clear all cache. Try insert link and get this in editor:
<p><a href="https://www.drupal.org/" id="" rel="" target="" title="">Test</a></p>This only first time link create with empty all attributes.
If I click Edit this link and (do nothing) click Save, I get this:
<p><a href="https://www.drupal.org/">Test</a></p>Comment #5
anonThis is not as simple as it looks. I had the same problem with in the Linkit module.
When editing a link, returning empty attributes will remove the attribute from the link, but when adding, there is no check in the savecallback javascript to remove empty attributes.
So we need to handle add and edit in different ways.
The first problem is to know the state in the form (add or edit). I think the patch shows the correct way, but I am not sure.
Then, in the submit callback, we need to use that state, and set unset the values if we are in an add state.
Comment #7
duaelfrI think I finally found something working in every cases.
Thanks for your help!