Cannot add link in CKEditor since recent portal release

Not applicable

Not sure which recent release of Apigee Developer Services is responsible for the CKEditor update, but since then it appears to be impossible to add a link. After filling the dialog with necessary information and pressing the OK button, nothing happens. The dialog should be dismissed and the link rendered in the editor.

Upon analysis using Chrome developer tools, we see the following error:

Uncaught TypeError: Cannot read property 'find' of undefined

Further examination of the code reference points to the following function:

Drupal.jsAC = function ($input, db, $context) {
  var ac = this;
  this.$context = $context;
  this.input = $input[0];
  this.ariaLive = $context.find('#' + this.input.id + '-autocomplete-aria-live');
  this.db = db;
  $input
    .keydown(function (event) { return ac.onkeydown(this, event); })
    .keyup(function (event) { ac.onkeyup(this, event); })
    .blur(function () { ac.hidePopup(); ac.db.cancel(); });
};

Any help is greatly appreciated.

0 2 377
2 REPLIES 2

Not applicable

OK apparently there is a patch for this on drupal.org: https://www.drupal.org/node/2594243

Here are the 'steps to replicate and fix' from that page:

1. Download and configure ckeditor_link module (or the recent Apigee developer services release in our case) 2. Try to link and get a javascript error 3. in sites/all/module/bootstrap/misc/autocomplete.js there is an unknown variable name $context.find 4. Remove and test

Now...here's our problem. We'll patch this, but risk the patch getting overwritten by subsequent Apigee Developer Services releases until the patch is included in their release. Therefore I will open a ticket with Apigee support to suggest they include this patch in their next release.

Not applicable

@Owen Wright: I am now following that Drupal issue. When the status on the issue stabilizes (i.e. when it is "ready to be tested by the community") I will add the patch to our bundled copy of Bootstrap. Right now it looks like the patch is still undergoing tweaks and adjustments.

If you fix this now, take note of the git commit hash in which you add the patch. When we update our upstream repository and you attempt to merge upstream updates, if you encounter git conflicts, you will want to revert that commit before accepting upstream updates:

git revert <commit_hash>