U4-6344 - TinyMCE RTE style_formats configuration changes?

Created by Christopher Bell 02 Mar 2015, 17:26:21 Updated by Christopher Bell 19 Mar 2015, 18:49:41

Relates to: U4-6345

After upgrading from version 7.1.8 to 7.2.2 TinyMCE no longer loads if we add "style_formats" to tinyMceConfig.config. Google Chrome reports an error in tinymce.min.js:

{code:|title=Console Error in tinymce.min.js} Uncaught TypeError: Cannot assign to read only property 'name' of [ (anonymous function) i n o a (anonymous function) r.fire m.add N.init (anonymous function) (anonymous function) i r.loadScripts.h (anonymous function) n

Has this somehow changed based on the work completed for http://issues.umbraco.org/issue/U4-1736 ? The configuration we had worked perfectly in 7.1.8.

A simple example of the config property: [ {"title": "H1 Header", "block": "h1"} ]

We also tried this on a fresh, non-upgraded 7.2.2 Umbraco installation.

This is a showstopper for our clients. Any thoughts?

Comments

Shannon Deminick 09 Mar 2015, 05:48:53

I'm not sure what has changed, I've reverted the PR for the http://issues.umbraco.org/issue/U4-1736 but this error still shows up so it would appear that issue 1736 isn't the cause for this.

You can use the methodology listed in that issue and PR to achieve this without the custom config block: https://github.com/umbraco/Umbraco-CMS/pull/630

I'll try to find out why that error is being thrown in the meantime.


Shannon Deminick 09 Mar 2015, 06:32:42

I'm not sure how this would have previously worked because the style_formats in the config file produces a string value and it needs to be turned into a JSON value for it to work with tinymce, but this has never been coded that way, so seems strange that it could have previously worked.

But anyways, it's fixed in rev: 2834ccdc2b057619178b3df49aa05ae938faca15, any custom style_format code put into the config file will be concatenated with the built in style formats which can easily be achieved with the correct use of stylesheets in the back office


Christopher Bell 19 Mar 2015, 18:49:41

Tested and confirmed this functionality is now back in the 7.2.3 core! Very nice work, Shannon.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.2

Due in version: 7.2.3

Sprint:

Story Points:

Cycle: