Dear,

When updating to core 8.5.2, webform "wysiwyg" fields break.

It seems that webform refers to "core/core.libraries.yml"
(WebformLibrariesManager.php l: 254 - 255)

  protected function initLibraries() {
    // Get Drupal core's CKEditor version number.
    $core_libraries = Yaml::decode(file_get_contents('core/core.libraries.yml'));
    $ckeditor_version = $core_libraries['ckeditor']['version'];

In this file we refer to ckeditor "4.8.0+2018-04-18-security-patch". (l 26 -27
This does not exist anymore and thus it fails loading some plugins and this breaks ckeditor.

ckeditor:
  remote: https://github.com/ckeditor/ckeditor-dev
  version: "4.8.0+2018-04-18-security-patch"
  license:
    name: GNU-GPL-2.0-or-later
    url: https://github.com/ckeditor/ckeditor-dev/blob/4.8.0/LICENSE.md
    gpl-compatible: true
  js:
    assets/vendor/ckeditor/ckeditor.js: { preprocess: false, minified: true }

Changing the version to "4.9.2" fixes the problem.

Can anyone confirm this ?

Comments

Mschudders created an issue. See original summary.

mschudders’s picture

mschudders’s picture

Issue summary: View changes
cilefen’s picture

cilefen’s picture

cilefen’s picture

Project: Drupal core » Webform
Version: 8.5.2 » 8.x-5.x-dev
Component: javascript » Code
Priority: Major » Critical

I am moving this to webform as per @jrockowitz.

damienmckenna’s picture

Would it be enough to just use the x.y.z portion of the string?

jrockowitz’s picture

@DamienMcKenna Yes, it should be a one-line fix. I will look into it. I might decide to pull the version number from the ckeditor URL.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

I just need someone to review the patch and mark this RTBC.

webchick’s picture

I wonder if an approach like this would work a bit better? https://drupal.stackexchange.com/questions/226044/how-to-access-library-... Basically, leveraging core's libraries API vs. Webform implementing its own workaround.

jrockowitz’s picture

StatusFileSize
new3.71 KB
new188.19 KB

Yep, it is much smarter to get the CKEditor version number from the library.discovery service because this would account for the CKEditor library and version number being altered and the Webform module would now be able to recognize the updated version number.

It is little strange how the library.discovery service is including the Drupal Core version and the CKEditor version.

@webchick Thanks for the suggestion. I am so used to parsing YAML I did not think to use an API.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

We confirmed that this fixes the problem for us and yes, using the API looks nicer than directly reading the file. You never know if someone alters that file to switch it with a different version for example.

Possibly wouldn't hurt to have a test for it, but setting to RTBC anyway.

  • jrockowitz committed 3db180d on 8.x-5.x
    Issue #2962352 by jrockowitz: Core 8.5.2 breaks webforms
    
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed
jrockowitz’s picture

wim leers’s picture

Issue summary: View changes

👌

Status: Fixed » Closed (fixed)

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