Problem/Motivation
With the introduction of a custom skin path in #2671806: Add custom skin support, the UI Color Picker breaks when a custom skin is used.
Steps to reproduce
- Create a new folder for skins.
- Add a skin inside of it (any skin except those that come bundled with CKEditor).
- Edit the Global Profile and set the "Path to the CKEditor skins directory" field to the new skins folder path. Save the page.
- Edit the Global Profile and choose one of the new skins. Save the page.
- Edit a profile.
- Scroll down to the "Editor Appearance" section and expand it.
- Scroll down to the area that says "User interface color" and look beneath the dropdown.
- When it's working, you should see a basic version of the editor. But in this case, I see a blank area.
Proposed resolution
That blank area is the "skinframe" page which is essentially:
/admin/config/content/ckeditor/skinframe?skin=NAME-OF-SKIN
In the code that generates that page, the call to CKEDITOR.replace('editor', {...}) uses the skin name from the URL query string. But when the editor loads that skin, it loads it from the skins folder inside of the ckeditor path.
The resolution is to change the "skin" JavaScript variable to use a key/value format that ckeditor accepts, i.e. "skin-name,skin-path". For example: "moonocolor,/sites/all/libraries/ckeditor_skins/moonocolor/". We can accomplish this by inserting the skin path from the Global Profile into the JavaScript skin name.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ckeditor-ui_color_picker_broken-3250088-2.patch | 1.18 KB | hargobind |
Comments
Comment #2
hargobindAttached is a patch which includes the resolution mentioned above.
Comment #3
hargobindComment #4
vokielConfirmed that the patch solves the issue.
Thanks a lot!
Comment #6
vokielComment #7
hargobindNice! Glad it was so simple. Thanks for being on top of the issue queue and committing this so quickly 😁