Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 939 posts 2574 karma points
    Mar 22, 2011 @ 09:55
    Claushingebjerg
    0

    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)

    Any ideas why?

  • Pasang Tamang 258 posts 458 karma points
    Mar 22, 2011 @ 10:38
    Pasang Tamang
    0

    Try this once

    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1'] [umbraco.library:DateGreaterThanOrEqualToday(@visTil)]">
  • Claushingebjerg 939 posts 2574 karma points
    Mar 22, 2011 @ 11:23
    Claushingebjerg
    0

    No difference. Gives the same error

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Mar 22, 2011 @ 11:27
    Chriztian Steinmeier
    0

    Hi Claus,

    Try this to look for any childnode(s) that could throw this error:

    <xsl:for-each select="$currentPage/*[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>

    /Chriztian

  • Pasang Tamang 258 posts 458 karma points
    Mar 22, 2011 @ 11:42
    Pasang Tamang
    0

    This works for me

    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1'] [umbraco.library:DateGreaterThanOrEqualToday($currentPage/* [name() ='visTil'])]">
    --some codes
    </xsl:for-each>

  • Claushingebjerg 939 posts 2574 karma points
    Mar 22, 2011 @ 11:46
    Claushingebjerg
    0

    @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.

     

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Mar 22, 2011 @ 11:52
    Chriztian Steinmeier
    0

    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:

    <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>
    

    /Chriztian

  • Claushingebjerg 939 posts 2574 karma points
    Mar 22, 2011 @ 12:13
    Claushingebjerg
    0

    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?!?!

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Mar 22, 2011 @ 12:46
    Chriztian Steinmeier
    0

    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

  • Claushingebjerg 939 posts 2574 karma points
    Mar 22, 2011 @ 12:59
    Claushingebjerg
    0

    using

     

       <p>(<xsl:value-of select="@id"/>) - (<xsl:value-of select="visTil"/>)</p

     

    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)

  • Claushingebjerg 939 posts 2574 karma points
    Mar 24, 2011 @ 09:23
    Claushingebjerg
    0

    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

     

     

  • Bruno Olsen 75 posts 316 karma points
    Jun 04, 2014 @ 13:17
    Bruno Olsen
    1

    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 :)

  • 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