Problem/Motivation
After updating to the release Paragraphs Features 8.x-1.10
https://www.drupal.org/project/paragraphs_features/releases/8.x-1.10
Bug #3157216: JS very theme specific
Steps to reproduce
Given that the paragraphs_features module was updated to 8.x-1.10 by the composer
When we try to edit any content or block content with a text format which are using the CKEditor
Then the CKEditor will not load mostly when we Edit the content
And the console log will have
Uncaught TypeError: Cannot read property 'split_text' of undefined
at isValidParagraphsField (plugin.js?t=qgn2hv:225)
at Object.init (plugin.js?t=qgn2hv:243)
at Object.<anonymous> (ckeditor.js?v=4.14.1:272)
at d (ckeditor.js?v=4.14.1:252)
at Array.n (ckeditor.js?v=4.14.1:253)
at y (ckeditor.js?v=4.14.1:253)
at ckeditor.js?v=4.14.1:254


Proposed resolution
Change the logic in
// Paragraphs split text should work only on widgets where that option is enabled.
var paragraphWrapperId = $subForm.closest('.paragraphs-tabs-wrapper').attr('id');
if (typeof drupalSettings.paragraphs_features.split_text === 'undefined' || !drupalSettings.paragraphs_features.split_text[paragraphWrapperId]) {
return false;
}
To
if (typeof drupalSettings.paragraphs_features !== 'undefined') {
if (typeof drupalSettings.paragraphs_features.split_text === 'undefined') {
return false;
}
else {
// Paragraphs split text should work only on widgets where that option is enabled.
var paragraphWrapperId = $subForm.closest('.paragraphs-tabs-wrapper').attr('id');
if (!drupalSettings.paragraphs_features.split_text[paragraphWrapperId]) {
return false;
}
}
}
else {
return false;
}
Remaining tasks
Release
User interface changes
not to load with CKEditor without being configured in the text format
A filter or a button should be configured first. then the split text should be allowed to split by button or by filter
But not auto for all text formats which are using CKEditor.
Test Create Basic page
Test Add Basic block
API changes
N/A
Data model changes
N/A


Comments
Comment #2
rajab natshahComment #3
rajab natshahChanged the logic to
Checked Drupal Standard and Drupal Practice
Comment #4
rajab natshahComment #5
rajab natshahComment #6
volkerk commentedHi,
thank you for finding this issue.
I already created a pull request here: https://github.com/thunder/paragraphs_features/pull/32
Comment #7
seppe beelprez commentedPatch in #3 is working. Thx!
Comment #8
utcwebdev commentedNothing to add, other than confirmation of this bug on a project that uses Thunder along with Layout Builder when testing composer update to Drupal 8.9.5 and Thunder 3.5.4... CKEditor is not visible to any user role when editing layout builder blocks.
Comment #9
utcwebdev commentedPatch in #3 works for me.
Comment #10
proweb.ua commented#3 works
Comment #11
volker23 commentedPatch in #3 works. Thank you!
Comment #12
nicholasspatch #3 works
Comment #13
vladimirausTested on 2 websites: Drupal 8.9 and Drupal 9.0.
Comment #14
indigoxela commentedI can confirm that the patch fixes the problem.
Comment #16
vladimirausThanks everyone for contributing.
Comment #17
volkerk commentedComment #18
rajab natshahThank you Vladimir, Volker,
Tested the committed fix, better logic.
I confirm that the issue was fixed.
Waiting for a release.
Comment #19
rajab natshah