Problem/Motivation

In the plugin settings form in the text format configuration page, the description says in bold:

(Note:- Please ensure you have enabled "Limit allowed HTML tags and correct faulty HTML" filter for this setting to take effect.)

If a site builder goes ahead and adds a value without enabling the filter, then editors will see the following warning on every node form (or likely, an entity form that makes use of a formatted text input):

Warning: Cannot use a scalar value as an array in /Users/myuser/Sites/mysite/docroot/modules/contrib/ckeditor_acr/ckeditor_acr.module on line 48

Steps to reproduce

Install CKEditor ACR and for one of the text formats add a value such as "a{!href]" in the CKEditor Allowed Content Rules configuration vertical tab but do NOT enable the "Limit allowed HTML tags and correct faulty HTML" filter for the format, and save the text format.

Go to a node creation form and observe the error above the body field's WYSIWYG editor.

Proposed resolution

Within ckeditor_acr_editor_js_settings_alter() check that $editor['editorSettings']['allowedContent'] before trying to inject any provided rules as allowedContent settings.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mandclu created an issue. See original summary.

mandclu’s picture

Status: Active » Needs review

Adding a simple check to the existing conditional wrapper appears to fix the warning.

Bunty Badgujar made their first commit to this issue’s fork.

bunty badgujar’s picture

Status: Needs review » Fixed

Thanks @mandclu

Status: Fixed » Closed (fixed)

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

p4trizio’s picture

Can you please tag a new release?
Thanks