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

FIX TinyMCEConfig image size presets handle incorrect values #9733

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion _config/html.yml
Expand Up @@ -16,7 +16,7 @@ SilverStripe\Core\Injector\Injector:

SilverStripe\Forms\HTMLEditor\TinyMCEConfig:
image_size_presets:
- width: 600,
- width: 600
i18n: SilverStripe\Forms\HTMLEditor\TinyMCEConfig.BEST_FIT
text: Best fit
name: bestfit
Expand Down
4 changes: 4 additions & 0 deletions src/Forms/HTMLEditor/TinyMCEConfig.php
Expand Up @@ -694,6 +694,10 @@ private function initImageSizePresets(array &$settings): void
}

foreach ($settings['image_size_presets'] as &$preset) {
if (isset($preset['width'])) {
$preset['width'] = (int) $preset['width'];
}

if (isset($preset['i18n'])) {
$preset['text'] = _t(
$preset['i18n'],
Expand Down