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 TinyMCE custom config issue #1507

Conversation

sabina-talipova
Copy link
Contributor

@sabina-talipova sabina-talipova commented May 1, 2023

Description

Renamed default skin from lightgray theme name to existing silverstripe theme if skin settings value is not defined.
This solution won't work if passed skin name to the editor settings is nonexistent directory.

Test instruction in installer

Modify app/_config.php

<?php

use SilverStripe\Security\PasswordValidator;
use SilverStripe\Security\Member;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\HTMLEditorConfig;

$validator = PasswordValidator::create();
Member::set_password_validator($validator);

// WYSIWYG editor config
$config = HTMLEditorConfig::get('cms');// use 'cwp' if installed with kitchen sink
$config->setOption('skin', null); 

Parent issue

@sabina-talipova
Copy link
Contributor Author

Close as wrong

@sabina-talipova sabina-talipova deleted the pulls/1.13/fix-tinymc-skins-issue branch May 1, 2023 23:11
@sabina-talipova sabina-talipova restored the pulls/1.13/fix-tinymc-skins-issue branch May 2, 2023 00:16
@sabina-talipova sabina-talipova force-pushed the pulls/1.13/fix-tinymc-skins-issue branch from ab2c9dd to 7849e18 Compare May 2, 2023 00:21
@GuySartorelli
Copy link
Member

GuySartorelli commented May 3, 2023

I've updated the code snippet to be a much simpler setup for reproducing the original bug. This simply unsets the skin on all default WYSIWYG editors. No need to add new fields anywhere or define a whole new config. Jjust check the existing content field on a page, or inside elemental blocks, etc.

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and elegant! Works great locally in entwine and react contexts. Still allows a custom skin to be defined.

@GuySartorelli GuySartorelli merged commit 2e2983b into silverstripe:1.13 May 3, 2023
@GuySartorelli GuySartorelli deleted the pulls/1.13/fix-tinymc-skins-issue branch May 3, 2023 00:23
@GuySartorelli
Copy link
Member

Tagged as 1.13.1

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

Successfully merging this pull request may close these issues.

2 participants