So, #1936392: Configure CKEditor's "Advanced Content Filter" (ACF) to match Drupal's text filters settings broke #1894644: Unidirectional editor configuration -> filter settings syncing.

The reason is that the former sets allowedContent on all CKEditor instances, including the hidden CKEditor instance that the latter uses to perform its magic. Because ACF is configured for the hidden CKEditor instance, each button no longer comes with a set of ACF rules (because the former overrides them), and hence the feature is broken.

Result: when e.g. the "subscript" button is added to the "Basic HTML" text format, the <sub> tag is no longer being added. The trivial patch fixes that.

CommentFileSizeAuthor
#1 2028457-1.patch1.36 KBWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Title: Configuring CKEditor's ACF broke CKEditor configuration -> filter setting syncing. » Configuring CKEditor's ACF broke CKEditor configuration -> filter setting syncing
Status: Active » Reviewed & tested by the community
FileSize
1.36 KB

I'm not normally in favor of RTBC'ing directly, but: this is a simple patch, and I'm one of the very few people who know this, and the only one who knows it in-depth. So, rather than waiting a week to get to RTBC, I'd rather get this simple, critical bugfix committed now.

quicksketch’s picture

Makes sense to me. I'm not sure I could be much clearer than Wim's original post but here's a stab:

- We collect the list of tags from individual plugins' "allowedContent" setting via a hidden CKEditor instance on the page.
- However if you set the *global* "allowedContent" variable on the editor, the plugin settings are ignored.
- So before initializing our hidden CKEditor instance, we need to remove the global "allowedContent" setting so the individual plugin settings come through, allowing us to pull in an accurate tag list.

So that's what this simple patch does, simply unsets the allowedContent variable before initializing the editor. RTBC +1.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks!

Wim Leers’s picture

Issue tags: -sprint

.

Automatically closed -- issue fixed for 2 weeks with no activity.