Copied to clipboard

Flag this post as spam?

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


  • William Schwartz 16 posts 85 karma points
    May 08, 2014 @ 19:37
    William Schwartz
    0

    Server Error when mediaCurrent as a Macro Parameter is empty (6.1.x)

    I originally posted my question in similar thread, but I figured I start a new topic to see if anyone has come across this issue.

    So here's my problem.

    I have a macro where, among other things, a user selects an image [mediaCurrent] (it's the only reason to choose the macro) and can optionally choose another image as a target [mediaCurrent]. The second parameter is optional (at least I would like it to be). When both parameters have a value there is no error but when one is empty IIS throws a Server Error "Input string was not in a correct format". The Stack Track ends up like this:

    [FormatException: Input string was not in a correct format.]
       System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +14419385
       System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +305
       umbraco.macro.AddMacroXmlNode(XmlDocument umbracoXml, XmlDocument macroXml, String macroPropertyAlias, String macroPropertyType, String macroPropertyValue) +1885
       umbraco.macro.LoadMacroXslt(macro macro, MacroModel model, Hashtable pageElements, Boolean throwError) +902
    

    The error is similar (if not the same) as the one posted in more detail at http://our.umbraco.org/forum/getting-started/installing-umbraco/44179-Error-on-upgrade-from-605-to-613?p=0#comment183190

    I'm not sure how to get around this. Is it possible to set a default value for a parameter to bypass the error? Or is there another way to have a user select a media node?

    Thanks, Wm

Please Sign in or register to post replies

Write your reply to:

Draft