umbraco.library:DateGreaterThanOrEqualToday error after upgrading to 4.7
I just upgraded a 4.5.2 install to 4.7 and everything went pretty smooth until now.
I have list pof events limited by umbraco.library:DateGreaterThanOrEqualToday. But this suddenly doenst work after the upgrade
On the document type for the evetn i have a parameter slled "visTil" which is the date it should be hidden.
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1'] [umbraco.library:DateGreaterThanOrEqualToday(visTil)]">
but now it give me an error:
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
Need to include the document filter - those are the properties of $currentPage you're getting, which of course doesn't have neither a nodeName nor an id attribute.
For the record, here's the corrected "diagnostics" code:
<xsl:for-each select="$currentPage/*[@isDoc][not(visTil) or not(normalize-space(visTil))]">
<p>Empty (or non-existing) "visTil" property found on: <xsl:value-of select="@nodeName" /> (<xsl:value-of select="@id" />)</p>
</xsl:for-each>
Ok, so now your debug code returns no nodes, but i still get
Error occured
System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
when doing
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1'] [umbraco.library:DateGreaterThanOrEqualToday(visTil)]">
I dont get why this worked in 4.5.2 and not 4.7... Has something changed or do you think it lies deeper... An install issue on an xslt extension perhaps?!?!
I'm quite positive that it's still a single roque value causing this...
So next step would be to drop the [umbraco.library:DateGreaterThanOrEqualToday(visTil)] and just output the visTil property and see if any of those contains a space or some other unparseable character...
Ok, for whatever reason it nows works. Im still getting
Error occured
System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
when saving the xslt, but it renders correctly front end... Strange
Thank you Claus, for posting that last post :) Ran into exactly the same issue. But that last post made me try to save without error-checking and test - sure enough, it worked :)
umbraco.library:DateGreaterThanOrEqualToday error after upgrading to 4.7
I just upgraded a 4.5.2 install to 4.7 and everything went pretty smooth until now.
I have list pof events limited by umbraco.library:DateGreaterThanOrEqualToday. But this suddenly doenst work after the upgrade
On the document type for the evetn i have a parameter slled "visTil" which is the date it should be hidden.
but now it give me an error:
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
Any ideas why?
Try this once
No difference. Gives the same error
Hi Claus,
Try this to look for any childnode(s) that could throw this error:
/Chriztian
This works for me
@Chrisztian
Well, that returned something interesting. It returned a number of nodes with the visTil not set. But it also returned this:
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
Empty (or non-existing) "visTil" property found on: ()
So a series of nodes with no name and no id hasnt got the visTil defined ?!?!?!
Correcting the dates on the nodes with an actual id did not fix the issue.
Hi Claus,
Oh sorry - that's a facepalm moment for me :-)
Need to include the document filter - those are the properties of $currentPage you're getting, which of course doesn't have neither a nodeName nor an id attribute.
For the record, here's the corrected "diagnostics" code:
/Chriztian
Ok, so now your debug code returns no nodes, but i still get
Error occured
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
when doing
I dont get why this worked in 4.5.2 and not 4.7... Has something changed or do you think it lies deeper... An install issue on an xslt extension perhaps?!?!
I'm quite positive that it's still a single roque value causing this...
So next step would be to drop the [umbraco.library:DateGreaterThanOrEqualToday(visTil)] and just output the visTil property and see if any of those contains a space or some other unparseable character...
/Chriztian
using
Gives the following, which doesnt seem to have date errors
(1387) - (2010-11-21T01:00:00)
(1433) - (2011-03-02T00:00:00)
(1428) - (2010-11-26T19:00:00)
(1429) - (2010-11-26T19:00:00)
(1427) - (2010-11-28T00:00:00)
(1434) - (2011-03-02T00:00:00)
(1435) - (2011-03-02T00:00:00)
(1436) - (2011-03-02T00:00:00)
(1437) - (2011-03-02T00:00:00)
(1438) - (2011-03-02T00:00:00)
(1439) - (2011-03-01T00:00:00)
(1474) - (2011-01-08T00:00:00)
(1475) - (2011-01-31T00:00:00)
(1487) - (2011-01-22T21:00:00)
(1500) - (2011-02-28T20:00:00)
(1501) - (2011-03-01T23:00:00)
(1502) - (2011-03-03T23:00:00)
(1503) - (2011-02-18T17:00:00)
(1558) - (2011-03-04T00:00:00)
(1561) - (2011-03-05T00:00:00)
(1562) - (2011-03-05T00:00:00)
(1563) - (2011-03-05T00:00:00)
(1600) - (2011-03-31T00:00:00)
(1612) - (2011-04-14T00:00:00)
Ok, for whatever reason it nows works. Im still getting
Error occured
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
when saving the xslt, but it renders correctly front end... Strange
Thank you Claus, for posting that last post :) Ran into exactly the same issue. But that last post made me try to save without error-checking and test - sure enough, it worked :)
is working on a reply...