Skip to content

Commit

Permalink
let the field be editable even if the cke config was deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
i-just committed Jan 2, 2025
1 parent edfac1a commit 9bd1905
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/templates/_field-settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}) }}
Expand Down

0 comments on commit 9bd1905

Please sign in to comment.