Copied to clipboard

Flag this post as spam?

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


  • Antony Doyle 6 posts 26 karma points
    Aug 23, 2012 @ 18:09
    Antony Doyle
    0

    NiceUrl system overflow exception

    Hi all.

    I apologise if this has already been asked, but I have spent the last hour searching and most of the posts seem to cover the old syntax and/or just doesn't seem to work.

    I'm pretty new to Umbraco (usually work in Joomla / PHP), so this is all quite new and strange to me. :)

    I've created an xslt file and macro to pull data from a content picker field into a 'read on' style button.

    Here is my code;

      <a class="small-btn blue rounded-1" href="{umbraco.library:NiceUrl($currentPage/readOnLink)}">Read on</a>

    Works perfectly.

    However, I need three of these, so I figured I'd simply rename the node readOnLinkOne and then repeat the process for each button (there is probably a much more elegant way, but this seemed simple).

    So I changed the code to;

      <a class="small-btn blue rounded-1" href="{umbraco.library:NiceUrl($currentPage/readOnLinkOne)}">Read on</a>

    And now it doesn't work. I have changed the field aliases etc in the doctypes and in the templates to match the new code. 

    This is the error;

    System.OverflowException: Value was either too large or too small for an Int32.
       at System.Convert.ToInt32(Double value)
       at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
       at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
       at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
       at (XmlQueryRuntime 
    {urn:schemas-microsoft-com:xslt-debug}runtime)
       at Root(XmlQueryRuntime 
    {urn:schemas-microsoft-com:xslt-debug}runtime)
       at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, 
    XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter 
    writer)
       at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable 
    input, XsltArgumentList arguments, TextWriter results)
       at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, 
    XslCompiledTransform xslt, Dictionary`2 parameters)
       at 
    umbraco.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object
     sender, EventArgs e)

    I found a suggestion on here somewhere to add an if statement around it, like thus;

     <xsl:if test="$currentPage/readOnLinkOne != null">
      <a class="small-btn blue rounded-1" href="{umbraco.library:NiceUrl($currentPage/readOnLinkOne)}">Read on</a>
        </xsl:if>

    But, while it fixes the error, now the XLST doesn't generate any output.

    Have I overlooked something? I tried looking through the documentation and at the tutorial videos, but again they seem to use the old syntax that no longer works.

    I appreciate any help / suggestions / shoves in the right direction!

     

    Thank you.

  • Jamie Howarth 306 posts 773 karma points c-trib
    Aug 23, 2012 @ 18:35
    Jamie Howarth
    0

    Hi Antony,

    I assume you've renamed the property on the doctype for your content picker. For the XSLT to run against the XML cache (which is one of the many reasons for Umbraco's speed) you now have to re-save and publish the node in question, so that the underlying XML is updated.

    HTH,

    Benjamin

  • Antony Doyle 6 posts 26 karma points
    Aug 23, 2012 @ 18:39
    Antony Doyle
    0

    Ah. That makes sense. And now it also works perfectly. 

    Thank you very much, Benjamin.

Please Sign in or register to post replies

Write your reply to:

Draft