diff --git a/src/Field.php b/src/Field.php index 35618d3f..22693e04 100644 --- a/src/Field.php +++ b/src/Field.php @@ -621,8 +621,17 @@ public function getSettingsHtml(): ?string ]; } + $ckeConfig = null; + if ($this->ckeConfig) { + try { + $ckeConfig = Plugin::getInstance()->getCkeConfigs()->getByUid($this->ckeConfig); + } catch (InvalidArgumentException) { + } + } + return $view->renderTemplate('ckeditor/_field-settings.twig', [ 'field' => $this, + 'ckeConfig' => $ckeConfig, 'purifierConfigOptions' => $this->configOptions('htmlpurifier'), 'volumeOptions' => $volumeOptions, 'transformOptions' => $transformOptions, diff --git a/src/templates/_field-settings.twig b/src/templates/_field-settings.twig index 219af324..45718648 100644 --- a/src/templates/_field-settings.twig +++ b/src/templates/_field-settings.twig @@ -5,7 +5,7 @@ id: 'cke-config', name: 'ckeConfig', options: plugin('ckeditor').ckeConfigs.getAll(), - value: field.ckeConfig ? plugin('ckeditor').ckeConfigs.getByUid(field.ckeConfig) : null, + value: ckeConfig ?? null, limit: 1, createAction: 'ckeditor/cke-configs/edit', }) }}