The file /core/modules/ckeditor/js/ckeditor.js depends on drupal.displace because it accepts parameters like this (last line of file)
})(Drupal, Drupal.debounce, CKEDITOR, jQuery, Drupal.displace, Drupal.AjaxCommands);
However the library file /core/modules/ckeditor/ckeditor.libraries.yml is missing that dependency.
It seems to be difficult to hit this bug. I guess that the libraries must normally end up being loaded in the order that works by happy coincidence. I found that I hit the bug when using Bootstrap theme and Admin Toolbar, but there might be other factors involved too. The error message I see in Firefox Console is "TypeError: displace is undefined[Learn More]"
Hopefully the need for the dependency is so obvious that this patch can be accepted even if the maintainer can't hit the bug.
Comment | File | Size | Author |
---|---|---|---|
#2 | ckeditor.dependency-2869570-2.patch | 467 bytes | AdamPS |
Comments
Comment #2
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedComment #3
Wim LeersExcellent catch! You're absolutely right.
Adding test coverage for this seems disproportionate.
Comment #4
tstoecklerComment #5
webchick@lauriii asked me to take a look. This seems like the kind of "oopsie" bug we're unlikely to ever have again, so I think we can get away without a dedicated test for this. I can't really picture a test that can check for this kind of problem anyway.
Comment #7
lauriiiCKEditor definitely has a dependency for core/drupal.displace which makes sense. Thank you @webchick for confirming that test coverage for this bug isn't worth the effort.
Committed 7e3527e and pushed to 8.4.x. Thanks!
This could be also potentially backported to 8.3.x.
Comment #8
AdamPS CreditAttribution: AdamPS at AlbanyWeb commentedThanks everyone
Comment #9
alexpottI discussed the backporting of this with @catch, we think this is good for a backport to 8.3.x - whilst on some sites it might need a hook_update_N to take affect, if some has the bug all they have to do is clear the cache and the bug is fixed.
Comment #10
lauriiiThank you @alexpott and @catch for confirming. Cherry-picked 3230622 and pushed to 8.3.x.
Comment #12
Wim Leers+1 to everything in #5, #7 and #9.
Thanks!