The part that fails is the image. If I remove it, it works. I honestly don't know enough about this to see if anything has changed / what is wrong (I usually work with PHP, .NET is completely alien to me!).
Can anyone point out where I'm going wrong or what I've missed?
The reason why this sometimes fails is because of the GetMedia extension. If some of your embedded content entries do not have an image the extension is receiving an empty value hence the error.
To avoid this you can make a check around the code like this:
<xsl:if test="clientImage"> <!--<img> stuff here --> </xsl:if>
This should fix it.
Btw you should use either true() or false() as the second parameter without the pling/single quotes, since that actually evaluates to true in this context. You could also just add either 0 or 1.
I tried your suggestion, but I'm still getting an error. But, if I ignore the error and save, it now works. For referrence, this is the error;
Error occured
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.presentation.webservices.codeEditorSave.SaveXslt(String
fileName, String oldName, String fileContents, Boolean ignoreDebugging)
I'm a little concerned about leaving it without fixing the error. Is this going to cause me problems down the line?
I agree with Jan - this looks like a GetMedia issue.
enclosing the <img>...</img> with an if:
<xsl:if test="normalize-space(clientImage) != ''"> <!--<img> stuff here --> </xsl:if>
should sort it out.
you could also just check that all the testimonials have valid entries for the image property - i.e. they actually link to a media item with an image, not to a folder or an empty media item.
Oh you're using the XSLT editor in Umbraco...the reason why it happens when you save the XSLT file is because the gemedia extension does not receive a value untill runtime, which is why it gives an error when you save it within Umbraco.
But you will see the same error at some point at your site if you don't make the suggested check if one of the entries has an empty image field.
I will urge you to edit your code in a proper editor like Sublime text or visual studio rather than using Umbraco to do this :)
That makes sense. I would use another text editor, I usually do, but I don't actually have FTP access, which just makes everything more difficult. It's probably tarnished my impression of Umbraco a little, though I do love how clean the markup is. :)
Thank you both for your help though. It is very much appreciated.
XSLT stopped working (mediapicker)
Hi.
I'm completely baffled by this, as it was working until today and I haven't touched it. Whether my client has done something, I don't know.
Basically, I'm using the Embedded Content extension to add a testimonials block to their website.
It needs an image, a name, link and the quote itself.
Here's my XSLT;
The part that fails is the image. If I remove it, it works. I honestly don't know enough about this to see if anything has changed / what is wrong (I usually work with PHP, .NET is completely alien to me!).
Can anyone point out where I'm going wrong or what I've missed?
Thank you!
Hi Anthony
The reason why this sometimes fails is because of the GetMedia extension. If some of your embedded content entries do not have an image the extension is receiving an empty value hence the error.
To avoid this you can make a check around the code like this:
<xsl:if test="clientImage">
<!--<img> stuff here -->
</xsl:if>
This should fix it.
Btw you should use either true() or false() as the second parameter without the pling/single quotes, since that actually evaluates to true in this context. You could also just add either 0 or 1.
Hope this helps.
/Jan
Hi Jan.
Thank you for your reply.
I tried your suggestion, but I'm still getting an error. But, if I ignore the error and save, it now works. For referrence, this is the error;
I'm a little concerned about leaving it without fixing the error. Is this going to cause me problems down the line?
Thanks again for your help! :)
I agree with Jan - this looks like a GetMedia issue.
enclosing the <img>...</img> with an if:
<xsl:if test="normalize-space(clientImage) != ''">
<!--<img> stuff here -->
</xsl:if>
should sort it out.
you could also just check that all the testimonials have valid entries for the image property - i.e. they actually link to a media item with an image, not to a folder or an empty media item.
F
Hi Anthony
Oh you're using the XSLT editor in Umbraco...the reason why it happens when you save the XSLT file is because the gemedia extension does not receive a value untill runtime, which is why it gives an error when you save it within Umbraco.
But you will see the same error at some point at your site if you don't make the suggested check if one of the entries has an empty image field.
I will urge you to edit your code in a proper editor like Sublime text or visual studio rather than using Umbraco to do this :)
Hope the above makes any sense.
/Jan
Hi guys,
That makes sense. I would use another text editor, I usually do, but I don't actually have FTP access, which just makes everything more difficult. It's probably tarnished my impression of Umbraco a little, though I do love how clean the markup is. :)
Thank you both for your help though. It is very much appreciated.
Antony.
is working on a reply...