GetItem() NullReferenceException only in one environment
Hi Guys,
I have a very simple XSLT macro that lists the field names and string values from the field from the current page. It works perfectly in my test environment, but the exact same code won't even compile on the production environment. The machines both have the same version of Umbraco. Any ideas on how to fix this?
This is the error it gives while compiling on production:
[code]Error occured
System.NullReferenceException: Object reference not set to an instance of an object.
at umbraco.library.GetItem(Int32 nodeID, String alias)[/code]
GetItem() NullReferenceException only in one environment
Hi Guys,
I have a very simple XSLT macro that lists the field names and string values from the field from the current page. It works perfectly in my test environment, but the exact same code won't even compile on the production environment. The machines both have the same version of Umbraco. Any ideas on how to fix this?
This is the error it gives while compiling on production:
[code]Error occured
System.NullReferenceException: Object reference not set to an instance of an object.
at umbraco.library.GetItem(Int32 nodeID, String alias)[/code]
If I comment out this line, it works:
[code]<xsl:value-of disable-output-escaping="yes" select="umbraco.library:GetItem($currentPage/@id, .)"/>[/code]
This is the XSLT code:
[code]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/data [string(data [@alias='umbracoNaviHide']) != '1']/@alias">
<xsl:value-of select="."/>
<xsl:value-of disable-output-escaping="yes" select="umbraco.library:GetItem($currentPage/@id, .)"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>[/code]
is working on a reply...