Skip to content

[5.x]: Unable to load CKEditor plugins due to asset bundle namespace #592

@marcusgaius

Description

@marcusgaius

Description

When trying to register an asset bundle extending craft\ckeditor\web\assets\BaseCkeditorPackageAsset, sometimes the bundle isn't properly loaded within craft\ckeditor\web\assets\BaseCkeditorPackageAsset::$ckeditorPackages. When trying to register an identical asset bundle where the only change is the namespace, the package is registered properly. The package is also successfully registered if the body of the craft\ckeditor\Plugin::init() method is placed within the Craft::$app->onInit() callback.

Steps to reproduce

  1. Generate a Craft plugin
  2. Register a BaseCkeditorPackageAsset asset bundle with Ckeditor with varying root namespace.

Additional info

The packages should end up being registered depending on the namespace of the PHP package. While debugging, the plugins with namespace beginning in A/B/C would work, while the Plugins with namespaces beginning in D/E/F/... wouldn't work.

Local modules would always work.
Yii2 Extensions (modules) would always work.

  • Craft version: 5.10.3
  • PHP version: 8.2
  • Database driver & version: MySQL 8.0.40
  • Plugins & versions:
    • CKEditor 5.6.1
    • CKE Shy 2.0.2
    • Code Field 5.0.2
    • Elements Panel 3.0.1
    • Navigation 3.0.22
    • Neo 5.5.8
    • SEOmatic 5.1.21
    • Table Maker 5.0.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions