Problem/Motivation
When loading a node edit page with a paragraph field, which includes am editor enabled text area using the Paragraphs Classic widget, it does not seem to detect that CKEditor is being used, and fails to take the measures add the unsafe-inline CSP option.
This can be mitigated by allowing "unsafe-inline" globally for the "script-src-attr" setting. Which is not ideal.
I'm not sure what this module's policy is for supporting other modules, but Paragraphs is pretty common.
Steps to reproduce
* Install CSP.
* Install Paragraphs.
* Add a Paragraph field to a node, use the "Classic widget" and set the edit mode to closed.
* Create a node. with a paragraph that includes a CKEditor enabled text field.
Proposed resolution
Install the patch of the third comment.
Remaining tasks
...
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | paragraphs-Paragraphs_with_CSP_module_break_Ckeditor_in_closed_editing_mode-3279007-3.patch | 3.75 KB | nono95230 |
Issue fork paragraphs-3279007
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
Comment #2
nono95230 commentedComment #3
nono95230 commentedComment #4
pminfI can confirm that this is still an issue with Drupal 10.4.8 and Paragraphs 1.19.0.
Comment #7
pcambraI think this is simpler than what the patch is proposing but I might be missing something of course.
Comment #8
yashaswi18 commentedThe code change looks good to me, switching from
type="submit"withonClick="return false;"totype="button"is cleaner and more correct approach. Usingtype="button"natively prevents form submission without needing the inlineonClickhandler.Keeping this as Needs review for better confirmation that this fully resolves the original CKEditor/CSP issue.