Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add first party Special Character Plugin #354

Closed
twitcher07 opened this issue Jan 21, 2025 · 5 comments
Closed

Unable to add first party Special Character Plugin #354

twitcher07 opened this issue Jan 21, 2025 · 5 comments
Labels

Comments

@twitcher07
Copy link

twitcher07 commented Jan 21, 2025

Description

I am trying to add the Special Character plugin that is a first party plugin but I am getting the below error in the javascript console when editing the CKeditor config in craft:

special-characters.js?v=1737491694:5 Uncaught (in promise) TypeError: t is not a constructor
    at S._createDialogButton (special-characters.j…=1737491694:5:15907)
    at Object.callback (special-characters.j…=1737491694:5:14449)
    at to.create (ckeditor5-dll.js?v=1737491694:2:551656)
    at ToolbarBuilder.js:46:38

and the config editor looks like this:

Image

Here is my asset bundle that should be enabling the plugin:

<?php

namespace modules\CkeditorCustom\src\assets;

use Craft;
use craft\ckeditor\web\assets\BaseCkeditorPackageAsset;

/**
 * Ckeditor Customizations asset bundle
 */
class CkeditorCustomAsset extends BaseCkeditorPackageAsset
{
    public $sourcePath = '@modules/CkeditorCustom/assets';
    public $depends = [];
    public $js = [
        'js/mention.js',
        'js/special-characters.js'
    ];
    public $css = [];
    public array $pluginNames = [
        'Mention',
        'SpecialCharacters',
        'SpecialCharactersEssentials'
    ];
    public array $toolbarItems = [
        'specialCharacters'
    ];
}

Let me know if you need any more information.

Steps to reproduce

  1. Add Special Character plugin through a custom module.
  2. Navigate to CKeditor config editor in craft console.

Additional info

  • Craft version: 5.5.7
  • PHP version: 8.2
  • Database driver & version: MariaDB 10.11.7
  • Plugins & versions:
@twitcher07 twitcher07 added the bug label Jan 21, 2025
@i-just
Copy link
Contributor

i-just commented Jan 22, 2025

Hi, thanks for getting in touch! Which version of the Special Characters package did you use? The latest version of Craft’s CKEditor plugin (4.4.0) uses CKEditor 41.0.0, so I’d first try doing what you’re doing with version 41.0.0 of the Special Characters package.

@twitcher07
Copy link
Author

@i-just I was using Version 44.1.0 of the @ckeditor/ckeditor5-special-characters package. I will try the 41.0.0 version of the package and report back.

@i-just
Copy link
Contributor

i-just commented Jan 24, 2025

Sounds good! As it might matter in your case, yesterday, we released version 4.5.0 of the plugin (it requires Craft 5.6.0 or higher) which uses CKEditor 5 44.0.0.

@twitcher07
Copy link
Author

@i-just ok thanks for letting me know.

I can confirm I used the 41.0.0 version of the special characters package it that fixed the issue.

@i-just
Copy link
Contributor

i-just commented Jan 27, 2025

Thanks for the update. Glad you got it working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants