- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 51 pass, 1 fail The last submitted patch, 101: 2741945-101.patch, failed testing. View results →
While working on a patch for Linkit I failed to set a custom attribute as link text without completely overriding the plugin.js of drupallink.
drupallink uses this code to create the link text: var text = new CKEDITOR.dom.text(returnValues.attributes.href.replace(/^mailto:/, ''), editor.document);
Do I have to override the complete plugin to use another attribute returned by the editor dialog?
Eventually the following code fragment would be an option (as a patch), but maybe there is a better way.
// Use link URL as text with a collapsed cursor.
if (range.collapsed) {
// Shorten mailto URLs to just the email address.
var text = new CKEDITOR.dom.text(returnValues.attributes.href.replace(/^mailto:/, ''), editor.document);
if (editor.config.hasOwnProperty('drupalLink_attributeText') && returnValues.attributes.hasOwnProperty(editor.config.drupalLink_attributeText) && returnValues.attributes[editor.config.drupalLink_attributeText].length) {
// Use custom attribute as link text.
text = new CKEDITOR.dom.text(returnValues.attributes[editor.config.drupalLink_attributeText], editor.document);
}
range.insertNode(text);
range.selectNodeContents(text);
}
Needs review
1.0
Code
It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
The last submitted patch, 101: 2741945-101.patch, failed testing. View results →