This was caused by #2888723: ckeditor_stylesheets cache busting: use system.css_js_query_string.

The problem occurs with code like this:

/**
 * Implements hook_ckeditor_css_alter().
 */
function XXX_ckeditor_css_alter(array &$css, Editor $editor) {
  $css[] = public://theme/my.css;
}

In buildContentsCssJSSetting() the code first appends the $query_string and then calls file_create_url(). For a public: path file_create_url() seems to escape the ? in the query string to become %3F.

The correct code is to make appending the query string the last stage in this function.

Comments

AdamPS created an issue. See original summary.

adamps’s picture

StatusFileSize
new784 bytes

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

adamps’s picture

Status: Active » Needs review
StatusFileSize
new933 bytes

Re-roll

Status: Needs review » Needs work

The last submitted patch, 7: ckeditor-css.3121503-7.patch, failed testing. View results

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » CKEditor 4 - WYSIWYG HTML editor
Version: 9.5.x-dev » 1.0.x-dev
Component: ckeditor.module » Code

CKEditor has been removed from core, CKEditor 4 is removed from Drupal Core in 10.0.0

adamps’s picture

Project: CKEditor 4 - WYSIWYG HTML editor » Drupal core
Version: 1.0.x-dev » 10.1.x-dev
Component: Code » ckeditor5.module

I'm doubtful about this reassignment. I see no advantage to try to solve this issue in a deprecated ckEditor version.

If ckEditor 5 solves the problem, then this issue could be closed as fixed in Drupal 10. If not, then the issue is still open. Either way it seems to me it's a core issue. I propose that the next step is to retest with ckEditor 5 once that's stable in Drupal 10.

wim leers’s picture

Status: Needs work » Postponed (maintainer needs more info)

Very reasonable demand, @AdamPS!

CKEditor 4 is architected very differently from CKEditor 5.

CKEditor 4 uses an <iframe> for the editing area. Hence you can load CSS into it. Hence the CKEditor 4 module has a hook_ckeditor_css_alter() that this issue is talking about.

CKEditor 5 on the other hand does everything within the context of the current page; it does not use an <iframe>.

Consequently, there is no CKEditor 5-specific API to load styles — all you need to do is load the styles on the page that CKEditor 5 is used on, and make sure your CSS selector is prefixed with .ck-content. See https://www.drupal.org/node/3259165 for details.

Does that answer your question? 😊

adamps’s picture

Status: Postponed (maintainer needs more info) » Fixed

Great, thanks for the explanation then this seems to be fixed by D10 (or if you prefer outdated)

wim leers’s picture

Title: Custom ckeditor CSS is broken with public:// URLs » Custom CKEditor CSS is broken with public:// URLs

In 9.5 even! 😄

Status: Fixed » Closed (fixed)

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