The drupalimage plugin is making calls to drupallink.parseLinkAttributes & drupallink.getLinkAttributes without checking if drupallink is defined.

Files: 

Comments

dylanf created an issue. See original summary.

dylanf’s picture

nod_’s picture

Status: Active » Needs review
Issue tags: +JavaScript
droplet’s picture

Issue tags: +Needs JS testing
Tyler_Marshall’s picture

Status: Needs review » Reviewed & tested by the community
Wim Leers’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests
  1. No tests yet!
  2. +++ b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
    @@ -285,12 +285,15 @@
       // Override image2's integration with the official CKEditor link plugin:
       // integrate with the drupallink plugin instead.
    -  CKEDITOR.plugins.image2.getLinkAttributesParser = function () {
    -    return CKEDITOR.plugins.drupallink.parseLinkAttributes;
    -  };
    -  CKEDITOR.plugins.image2.getLinkAttributesGetter = function () {
    -    return CKEDITOR.plugins.drupallink.getLinkAttributes;
    -  };
    +  if (CKEDITOR.plugins.drupallink) {
    +    CKEDITOR.plugins.image2.getLinkAttributesParser = function () {
    +      return CKEDITOR.plugins.drupallink.parseLinkAttributes;
    +    };
    +    CKEDITOR.plugins.image2.getLinkAttributesGetter = function () {
    +      return CKEDITOR.plugins.drupallink.getLinkAttributes;
    +    };
    +  }
    

    AFAICT this will cause it to integrate with the official CKEditor link plugin instead.

    What are the consequences of that?

  3. +++ b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
    @@ -285,12 +285,15 @@
    +
     
       /**
    

    Unwanted newline addition.