Reviewed & tested by the community
Project:
Advanced CSS/JS Aggregation
Version:
5.0.0
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2022 at 12:50 UTC
Updated:
30 Oct 2023 at 15:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
seanbPatch is attached.
Comment #3
cameron prince commentedI noticed this bug last week and updated to 5.0 hoping it might fix it, but no dice. This patch does the trick.
Thanks!
Comment #4
tzt20 commentedSame here. Upgraded to 5.0, but this patch did the trick. Thank you!
Comment #5
sd123 commentedI managed to workaround this CKEditor 5 related bug without this patch by adding the following lines to the exclusion list in the settings of the MinifyJS module:
Thereafter I re-minified all files and deleted all caches.
Comment #6
ghost of drupal pastThanks for the patch.
It didn't work for us but the idea did. So I used the same idea but wrote a shorter and less restrictive version.
Comment #7
klemendev commentedDoes this issue apply to cke5 as seems in the patch, or cke4 as referenced in OP?
Asking because some of our websites are breaking sometimes with CKE5 (JS not working) and disabling JS minification fixes this
Comment #8
klemendev commentedOk did some checking. While #6 works, the problem is it removes check for CKE4 JS files
if ($path == 'core/assets/vendor/ckeditor/ckeditor.js') {so this needs to be re-added.
Changing to major as this randomly breaks any website using CKE5+ADVAGG MinJS
Comment #9
lucassc@KlemenDEV, It seems the regex in #6 still keeps the previous check with the "5?", making 5 optional.
So if
$path == 'core/assets/vendor/ckeditor/ckeditor.js'thenpreg_match('#/ckeditor5?\.js$#', $path)still returnstrue. Isn't that right?Comment #10
klemendev commentedCorrect, my bad, missed the question mark. RTBC in this case from my side as patch #6 fixed the problem with CKE5+ADVAGG on our websites.
Comment #11
GasparM commentedIt works perfectly, thanks
Comment #13
urvashi_vora commentedI was facing the same issue with CKEditor and ADVAGG.
Thanks for saving the struggle. Patch 3310388_6.patch worked perfectly.
RTBC++
Committing the patch #6 for helping the maintainers.
Comment #15
joco_sp commented#6 worked. Thank you
Comment #16
raghwendra commentedIn version "6.0.0-alpha1" Advagg didn't see the code line that is mention in the patch #6 , therefore not able to apply the patch. Any solutions ckeditor 5 and latest Advagg for Drupal 10 version ?
Comment #17
sleewok commentedYep, CKEditor is broken with 6.0.x-dev. If aggregation is enabled it will not load.
There is a pending merge request that we are waiting on.
For now here is a patch:
diff --git a/advagg_mod/advagg_mod.module b/advagg_mod/advagg_mod.module
index d2016d0..399a4eb 100644
--- a/advagg_mod/advagg_mod.module
+++ b/advagg_mod/advagg_mod.module
@@ -35,7 +35,7 @@ function advagg_mod_js_alter(&$js) {
if ($config->get('js_preprocess')) {
foreach ($js as $path => &$values) {
// However CKEditor must not be combined or errors *will* occur.
- if ($path == 'core/assets/vendor/ckeditor/ckeditor.js') {
+ if (preg_match('#/ckeditor5?\.js$#', $path)) {
continue;
}
$values['preprocess'] = TRUE;
Comment #18
sd123 commentedNeither patch #2, nor the merge request seem to be working. I am using 6.0.0-alpha1 and Drupal 10.0.11 and have the following other patches active: