U4-1052 - Revert TinyMCE OnLoad method

Created by Jeroen Breuer 17 Oct 2012, 13:10:42 Updated by Jeroen Breuer 22 Oct 2012, 08:42:15

Subtask of: U4-111

In Umbraco 4.5 is was easy to add TinyMCE to a custom section or dashboard, but in a later version the OnLoad method of TinyMCE changed. Now it doesn't seem to work anymore. It would be good if the OnLoad method would be changed back to how it was in 4.5. Here is the 4.5 code:

protected override void OnLoad(EventArgs e) { try { // add current page info base.NodeId = ((cms.businesslogic.datatype.DefaultData)_data).NodeId; base.VersionId = ((cms.businesslogic.datatype.DefaultData)_data).Version; config.Add("theme_umbraco_pageId", base.NodeId.ToString()); config.Add("theme_umbraco_versionId", base.VersionId.ToString());

    // we'll need to make an extra check for the liveediting as that value is set after the constructor have initialized
    if (IsInLiveEditingMode)
        if (config["theme_umbraco_toolbar_location"] == null)
            config.Add("theme_umbraco_toolbar_location", "");
        config["theme_umbraco_toolbar_location"] = "external";

    ElementIdPreFix + ((cms.businesslogic.datatype.DefaultData)_data).PropertyId.ToString());

    // Empty catch as this is caused by the document doesn't exists yet,
    // like when using this on an autoform


More info: http://our.umbraco.org/projects/collaboration/blog-4-umbraco/using-blog-4-umbraco/18559-TinyMCE-not-showing-up-on-Blog-dashboard-on-v470?p=0#comment128842


Jeroen Breuer 18 Oct 2012, 08:22:58

This topic also has more info: http://our.umbraco.org/forum/developers/extending-umbraco/17750-Using-tinyMCE-in-custom-section

Sebastiaan Janssen 19 Oct 2012, 10:55:13

No we had to change this to fix several bugs. See the file's history in mercurial.

Jeroen Breuer 20 Oct 2012, 13:23:44

So far I've only been able to use TinyMCE in custom sections or a dashboard by reverting the code. Is there a way to use it without reverting the code? I've looked at history in mercurial and it fixed some thing for 4.6, but now it's not working in custom sections or a dashboard anymore so that seems like a new bug. Should I create a new issue for it to keep this new code, but also make it work in custom sections or a dashboard?

Sebastiaan Janssen 22 Oct 2012, 07:44:51

Yup, that would be best and make sure to add some details of why and how it doesn't work so someone can debug it as well.

Jeroen Breuer 22 Oct 2012, 08:42:15

New issue created: http://issues.umbraco.org/issue/U4-1066

Priority: Normal

Type: Bug

State: Closed


Difficulty: Easy


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:


Story Points: