Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputfieldCKEditor 'extraAllowedContent': empty module config setting prevents use of config.js #627

Closed
Toutouwai opened this issue Jun 28, 2018 · 3 comments

Comments

@Toutouwai
Copy link

Short description of the issue

When the InputfieldCKEditor module config field for "Extra Allowed Content" is empty, the module includes this as an empty string in the inline Javascript configuration for the field.

2018-06-28_155653

2018-06-28_155803

This prevents or overrides any extraAllowedContent option that might be defined for the field in config.js

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    config.extraAllowedContent = 'p(tip)';
};

Suggestion for a possible fix

Somewhere in InputfieldCKEditor::renderReady before the $settings array is passed to $config->js...

if(empty($settings['extraAllowedContent'])) unset($settings['extraAllowedContent']);

Setup/Environment

  • ProcessWire version: 3.0.106
@Toutouwai
Copy link
Author

Toutouwai commented Jun 28, 2018

Just thinking... if there is something defined for "Extra Allowed Config" in the module config then this will also prevent the use of extraAllowedContent in config.js.

Really, the settings in the inline JS and the linked config.js file should be merged, but I guess this could be seen as a CKEditor issue rather than a PW issue.

ryancramerdesign added a commit to processwire/processwire that referenced this issue Jul 16, 2018
@ryancramerdesign
Copy link
Member

Thanks, I've pushed your suggested fix for the issue. As to whether they should be merged, I think it just depends on what one's intention is, as the intention might be to completely override, which is what it does now. Though if it ever surfaces as a recurring problem for people we can look into more options.

@Toutouwai
Copy link
Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants