Exceptions for CKEditor 5 plugin definitions containing wildcard tags when PHP is built with libxml 2.9.14

Created on 16 May 2022, almost 3 years ago
Updated 27 August 2023, over 1 year ago

Problem/Motivation

We are currently working on a project where we have decided to upgrade to ckeditor5 from the get go. Our tests have started failing recently on our CI while still passing locally. Both sites had the same config & code.

After doing some digging I saw my local PHP version was 8.0.15 & CI was 8.0.19. I updated my PHP version locally to 8.0.19 and I was able to get the error there as well. It seems cause of the error is somewhere between PHP 8.0.15 & 8.0.19. This is why I've put a very specific PHP version in the title. 😅

Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "ckeditor5_alignment" CKEditor 5 plugin definition has a value at "drupal.elements.0" that is not an HTML tag with optional attributes: "<$text-container class="text-align-left text-align-center text-align-right text-align-justify">". Expected structure: "<tag allowedAttribute="allowedValue1 allowedValue2">". in Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition->validateDrupalAspects() (line 146 of core/modules/ckeditor5/src/Plugin/CKEditor5PluginDefinition.php).

Steps to reproduce

  • Be on Drupal 9.3 & PHP 8.0.19
  • Set a text format to be ckeditor5
  • Add the alignement item to the toolbar
  • Try edit the text format again or create a page with a field that uses that text format

Proposed resolution

Identify cause between PHP 8.0.15 - 8.0.19
Fix

Remaining tasks

All

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

🐛 Bug report
Status

Fixed

Version

9.3

Component
CKEditor 5 

Last updated 3 days ago

Created by

🇳🇿New Zealand danielveza Brisbane, AU

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024