When enabled boxes with CiviCRM and ckeditor, it breaks CiviCRM WYSIWYG as CiviCRM is using its own copy of ckeditor.

The culprit is boxes' hook_footer() that adds "window.CKEDITOR_BASEPATH" to every page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ckng’s picture

Status: Active » Needs review
FileSize
1.61 KB

See attached patch.

kienan’s picture

Re-rolled the patch to apply against latest 7.x-1.x-dev.

Status: Needs review » Needs work

The last submitted patch, 2: boxes_civicrm_wysiwyg_conflict-2175471-2.patch, failed testing.

happysnowmantech’s picture

Title: Incompatible with CiviCRM » Incompatible with CiviCRM - CKEditor WYSIWYG does not load

I encountered this problem, applied the patch, and verified that it resolved the issue.

Other symptoms of this bug include browser console errors similar to this:

Refused to apply style from 'https://<site_name>/sites/all/libraries/ckeditor/skins/moono-lisa/editor.css?t=I3I8' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Refused to apply style from 'https://<site_name>/sites/all/libraries/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Refused to apply style from 'https://<site_name>/sites/all/libraries/ckeditor/plugins/scayt/dialogs/dialog.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Refused to apply style from 'https://<site_name>/sites/all/libraries/ckeditor/plugins/wsc/skins/moono-lisa/wsc.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Refused to apply style from 'https://<site_name>/sites/all/libraries/ckeditor/plugins/tableselection/styles/tableselection.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

ckeditor.js:36 Uncaught TypeError: Cannot read property '224' of undefined
    at Object.keystrokeToArray (ckeditor.js:36)
    at Object.keystrokeToString (ckeditor.js:35)
    at CKEDITOR.ui.button.render (ckeditor.js:636)
    at G (ckeditor.js:647)
    at a.<anonymous> (ckeditor.js:649)
    at a.h (ckeditor.js:10)
    at a.<anonymous> (ckeditor.js:11)
    at a.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)
    at b (ckeditor.js:326)
    at a.<anonymous> (ckeditor.js:325)

Also updating the issue title to add more info.

happysnowmantech’s picture

Status: Needs work » Needs review
adixon’s picture

Confirming the rerolled patch resolved my identical issue, also reported here: https://civicrm.stackexchange.com/questions/25955/unable-to-use-ckeditor...
Curiously - the issue did not arise on the affected site until last week, though I've been using CiviCRM and boxes on it for serveral years.

jackalope’s picture

Confirming that as @happysnowmantech and @adixon say, patch #2 fixes Boxes issues with CiviCRM.

In my situation the text fields for "Pre-form Help" and "Post-form Help" on profile settings pages were mysteriously disappearing before I applied the Boxes patch, even though those no fields on that Civi screen use CKEditor or any other WYSIWYG!

jackalope’s picture

Ah, actually never mind that last bit--turns out those profile fields do indeed use the WYSIWYG, which is now working properly thanks to that Boxes patch! (Not sure why the patch is failing tests, though...)

jadag88’s picture

I'm still having this issue with Drupal 8 and CiviCRM 5.27.3. On the data entry forms for CiviCRM contribution pages and event pages, some of the input blocks are set to be hidden (e.g. Complete Description, Introductory Message, Footer Message), so no information can be input or changed. Drupal has made CKEditor part of core, but CiviCRM still has its own version of CKEditor. I can't find a way to make this patch work with our situation. What I ended up doing is turning off CKEditor in CiviCRM/Customize Data and Screens/Display Preferences--I changed Wysiwig Editor to Textarea. That leaves CKEditor from Drupal available for Drupal text entry and I will have to enter my own html for Civi text.