Firefox Macro issues (Fix here) Options
mrshrinkray
Posted: Friday, November 16, 2007 4:39:21 PM

Rank: Aficionado

Joined: 8/4/2006
Posts: 106
Location: London
For those of you suffering from this issue:

http://www.codeplex.com/umbraco/WorkItem/View.aspx?WorkItemId=11125

I've got the source code and done a fix for it, as it was affecting my website (ironically, breaking a page I've been making with Umbraco tips :)

As I don't have any edit rights on the source in codeplex, I've done the change and recompiled it. It's available here, the zip contains the change also:

http://www.sloppycode.net/media/43259/tinymce.zip

It's not a huge change, just slightly more rigid exception handling inside parseMacrosToHtml(). The source also has a change that means newline formatting isn't removed - this fixes problems with using <pre> tags with tinyMCE, it adds the line

remove_linebreaks : false

If you don't want this for some reason send me a message on Codeplex and I'll recompile it without the change.
mrshrinkray
Posted: Friday, November 16, 2007 4:39:55 PM

Rank: Aficionado

Joined: 8/4/2006
Posts: 106
Location: London
The ZIP contains the source code I meant to write.
apt-get
Posted: Friday, January 18, 2008 3:45:06 AM
Rank: Newbie

Joined: 10/30/2007
Posts: 5
thx. seems to work well.

I put umbraco.editorControls.dll in my /bin

What should i do with umbraco.editorControls.pdb ?
hartvig
Posted: Friday, January 18, 2008 7:15:55 AM

Rank: Addict

Joined: 3/17/2008
Posts: 953
Location: Nyborg, Denmark
Great Chris!

I'll add these changes to the core. I guess I'll need to look at the macro manipulation because of these changes, as there's a risk that the changes causes these to break, right?

I don't know if you've seen it, but I've also made a number of changes for better Firefox support in umbraco.

/n

Jeeeez, did I really start this :-)
kalpa
Posted: Friday, January 18, 2008 11:16:17 AM

Rank: Fanatic

Joined: 7/19/2006
Posts: 492
Location: Göteborg, Sweden
I just tried this one...

What I did was to place the umbraco.editorControls.dll file inside my /bin folder.

I then tried to insert a macro in a regular textpage and clicked on "save and publish" - BOOM!

Maybe I have a different issue going here!? This error occcurs in FF2 as well as in IE7 and IE6. My XSLT inserts a plain img tag with src set via a generic parameter.

The image shows up just fine in the editor prior to saving and works great directly in a template but not at all in the WYSIWYG editor...

Server Error in '/' Application.
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) +2819889
System.String.Substring(Int32 startIndex, Int32 length) +11
umbraco.editorControls.tinymce.TinyMCE.replaceMacroTags(String text) +110
umbraco.editorControls.tinymce.TinyMCE.Save() +114
umbraco.controls.ContentControl.saveClick(Object Sender, ImageClickEventArgs e) +80
umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +21
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


" - Yeah I'd like to share your point of view, as long as it's my view too... (http://www.d-a-d.dk/lyrics/pointofview)
chimnit
Posted: Monday, February 25, 2008 6:28:45 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 59
Hi everyone

I'm experiencing tghe same error. I insert a macro and save. If I save it again I experience the error described above.

/Kim
kalpa
Posted: Monday, February 25, 2008 10:15:30 PM

Rank: Fanatic

Joined: 7/19/2006
Posts: 492
Location: Göteborg, Sweden
Hi Kim.
I've solved at least the issues I had by changing some parts in the source that tried to find all macros with an "macroAlias" attribute set. This part would never work since tinyMCE changes all attribute names to lower case. I've seen one solution to this that modified the search to be non-case-sensitive. My solution was to modify the actual search pattern to macroalias which is a lowercase only version that seems to be working well so far...
i've done this in the latest source that will make this harder to implement in any binary release of 3.0.3...

// ;) Kalle

" - Yeah I'd like to share your point of view, as long as it's my view too... (http://www.d-a-d.dk/lyrics/pointofview)
chimnit
Posted: Tuesday, February 26, 2008 2:58:18 PM
Rank: Devotee

Joined: 10/25/2007
Posts: 59
Hi Kalle

Thanks for the reply. Just to recap, so what I have to do is alter the TinyMCE source where it fails, so that it searches for lower-case strings instead?
And then recompile and just replace the a DLL (which)?

Thanks a lot for the answer. That seems like a very plausible solution :o)

/Kim
kalpa
Posted: Tuesday, February 26, 2008 10:28:57 PM

Rank: Fanatic

Joined: 7/19/2006
Posts: 492
Location: Göteborg, Sweden
No I didn't touch the actual Tiny source, I made "macroAlias" all lowercase in:

method MacroContentByHttp
in file \presentation\insertMacros.cs
if (!ReturnFromAlias(attributes["macroAlias"].ToString()).DontRenderInEditor)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

And in the page presentation/umbraco/plugins/tinymce/insertMacros.aspx.cs:
if (Request["macroID"] != null || Request["macroalias"] != null)

I think that this is where the error is thrown, since macroAlias isn't found...

// Kalle



" - Yeah I'd like to share your point of view, as long as it's my view too... (http://www.d-a-d.dk/lyrics/pointofview)
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.