diff --git a/CHANGELOG.md b/CHANGELOG.md index c44f8a9..b7675a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for CKEditor for Craft CMS +## Unreleased + +- Fixed a bug where custom `toolbar` config settings were getting ignored. ([#522](https://github.com/craftcms/ckeditor/issues/522)) + ## 5.1.0 - 2026-03-05 - Updated CKEditor 5 to 47.6.0. ([#518](https://github.com/craftcms/ckeditor/pull/518)) diff --git a/src/Field.php b/src/Field.php index a059ed5..b1b7a98 100644 --- a/src/Field.php +++ b/src/Field.php @@ -1446,13 +1446,15 @@ private function _inputHtml(mixed $value, ?ElementInterface $element, bool $stat language: $languageJs, }, $baseConfigJs, $configOptionsJs, { plugins: $configPlugins, - toolbar: { - items: $toolbarJs - }, removePlugins: [] }); + if (!jQuery.isPlainObject(config.toolbar)) { + config.toolbar = {}; + } + config.toolbar.items = $toolbarJs; + // special case for heading config, because of the Heading Levels // see https://github.com/craftcms/ckeditor/issues/431 const baseHeadings = $baseConfigJs?.heading?.options;