Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gregg Duncan 48 posts 70 karma points
    Nov 22, 2011 @ 20:21
    Gregg Duncan
    0

    TinyMCE is removing <!-- startUmbMacro --> <!-- endUmbMacro --> from macro

    When adding a macro inside the Rich Text Editor, TinyMCE is removing the <!-- startUmbMacro --> <!-- endUmbMacro --> tags from my macro when saving. On the original save it works fine. But if you try to save it again you get the error listed below.

    Can you stop TinyMCE from stripping the comment tags? Or if the comment tags are not really required for the macro to function why is umbraco throwing the error?

    I cannot ask my users to delete the macro and then put it back every time they update the content or a property value on the page.

    I'm on Umbraco version 4.7.0 and .NET version 4.0. I have made no customizations to TinyMCE at all.

    Thanks for any help you can give on this.

    Gregg

     

    Length cannot be less than zero.
    Parameter name: length

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentOutOfRangeException: Length cannot be less than zero.
    Parameter name: length

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [ArgumentOutOfRangeException: Length cannot be less than zero.
    Parameter name: length]
       System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +12681946
       umbraco.editorControls.tinyMCE3.TinyMCE.replaceMacroTags(String text) +90
       umbraco.editorControls.tinyMCE3.TinyMCE.Save() +85
       umbraco.controls.ContentControl.saveClick(Object Sender, ImageClickEventArgs e) +185
       umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +24
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707 

     

  • Greg Berlin 818 posts 634 karma points
    Mar 24, 2012 @ 01:05
    Greg Berlin
    0

    I have the exact same problem... Did you find a solution?

    It seems when you reload a node with a macro in the editor, it removes the following comment:

      <!-- startUmbMacro --><!-- endUmbMacro -->

    If i click on the macro area, hit the macro button and then OK, it gets added back in (after the macro embed code, not around it strangely enough)... but if i try to insert it manually via the HTML editor it will still fail (so it seems you actually have to go through the process of adding or editing the macro - so something else seems to be happening in the background)

    Hoping this is a known bug as like Gregg in the post above, i can't expect my users to edit their macros every time they want to make a change to a page.

    Thanks all :)

  • Greg Berlin 818 posts 634 karma points
    Mar 24, 2012 @ 01:08
    Greg Berlin
    0

    Actually it's the act of "Updating" the HTML editor that causes the tags to be stripped out... so manually adding them back in was a waste of time.  Doh!

    Definitely a bug... fix anybody?

  • Greg Berlin 818 posts 634 karma points
    Mar 24, 2012 @ 04:21
    Greg Berlin
    0

    Ah yup i found it.. 

    http://umbraco.codeplex.com/workitem/30620

    Any idea when this is likely to be fixed?  Otherwise i could do it myself i guess... just worried about other bugs i may introduce by doing so?
  • Greg Berlin 818 posts 634 karma points
    Mar 25, 2012 @ 01:28
    Greg Berlin
    0

    Please vote for this to be fixed... http://umbraco.codeplex.com/workitem/30620

     

  • Greg Berlin 818 posts 634 karma points
    Mar 25, 2012 @ 04:15
    Greg Berlin
    0

    Hmmm... I inadvertently stumbled across a potential fix for this one.. just disable the TidyEditorContent switch in Umbraco.config:

            <!-- clean editor content with use of tidy -->

            <TidyEditorContent>False</TidyEditorContent>

    To be honest i'm not entirely sure what this tidy functionality is supposed to do, but for now this is working fine for me.

Please Sign in or register to post replies

Write your reply to:

Draft