Copied to clipboard

Flag this post as spam?

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


  • Moran 285 posts 934 karma points
    Sep 26, 2013 @ 10:53
    Moran
    0

    umbBlogCategories error

    I am getting an error when I try to run this macro on my site:

    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library"
      xmlns:tagsLib="urn:tagsLib"
      exclude-result-prefixes="msxml umbraco.library tagsLib">
    
    
    <xsl:output method="html" omit-xml-declaration="yes"/>
    
    <xsl:param name="currentPage"/>
    
    <xsl:variable name="blogRoot" select="$currentPage/ancestor-or-self::umbBlog/@id"/>
    
    <xsl:template match="/">
    <ul>
      <li class="cat-item"><a href="{umbraco.library:NiceUrl($blogRoot)}">All</a> <span>&nbsp;(<xsl:value-of select="count($currentPage/ancestor-or-self::umbBlog//umbBlogPost)"/>)</span></li>
      <xsl:for-each select="tagsLib:getAllTagsInGroup('default')/tags/tag">
            <li class="cat-link">
                <a href="{umbraco.library:NiceUrl($blogRoot)}?filterby={current()}"><xsl:value-of select="current()"/></a> (<xsl:value-of select="@nodesTagged"/>)
            </li>
      </xsl:for-each>
    </ul>
    
    </xsl:template>
    
    </xsl:stylesheet>
    

    I get this error:

    System.OverflowException: Value was either too large or too small for an Int32. 
    at System.Convert.ToInt32(Double value) 
    at System.Double.System.IConvertible.ToInt32(IFormatProvider provider) 
    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 Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) 
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) 
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) 
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) 
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
    

    Any ideas why? I am running umbraco version 4.11.8

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Sep 26, 2013 @ 11:27
    Chriztian Steinmeier
    100

    Hi Moran,

    This error almost always happens because the NiceUrl() extension is called with an empty value - so it seems the umbBlog node doesn't exist? Or: if the umbBlog node isn't an ancestor of the current page (i.e. if you're trying this on the Home page and your blog is on a childnode of the Home page...).

    /Chriztian

  • Moran 285 posts 934 karma points
    Sep 26, 2013 @ 13:18
    Moran
    0

    Thanks I have this document type, and it's on the same level of the page I am trying to insert this macro to,I think I will just insert it in the Blog post template. Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies