Copied to clipboard

Flag this post as spam?

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


  • Joss 10 posts 73 karma points
    Aug 24, 2015 @ 13:50
    Joss
    0

    Label datatype stripping leading zeros

    Hi!

    I have a label datatype with the value 026601620

    I then try to get the value using for example: umbracoProduct.Children(x => x.DocumentTypeAlias.Equals("ProductItem")).Select(x => x.GetPropertyValue

    This comes back as 26601620 (missing the leading zero). If I try it where the label is for example 826601620 it returns as it should.

    Any idea why Umbraco would strip the leading zero on a label datatype?

  • Joss 10 posts 73 karma points
    Aug 25, 2015 @ 08:57
    Joss
    0

    Did som more checking. On my import routines I use umbracoProductNodes.Where(x => x.GetValue<string>("productItemId"))

    And this gives me the correct value including the first 026601620, but still on umbracoProduct.Children(x => x.DocumentTypeAlias.Equals("ProductItem")).Select(x => x.GetPropertyValue("productItemId")) it is returned as 26601620

    I also tried to use a textfield instead of label datatype, and then it works.

    Now, I checked using GetProperty instead of GetPropertyValue. Reading the .GetProperty("productItemid").Value returns 26601620 while .GetProperty("productItemId").DataValue returns 026601620

    Something wrong on the source?

  • Joss 10 posts 73 karma points
    Dec 11, 2015 @ 14:57
    Joss
    0

    Anyone has time to look at this, or should i submit a ticket?

  • Linda 4 posts 34 karma points
    Feb 02, 2016 @ 23:03
    Linda
    0

    It seems only for Umbraco 7 issue. I used to use GetPropertyValue("Label") in Umbraco 6.2.2 and it's working well.

    GetPropertyValue("Label")

    Anyone has idea about it?

  • Magnus Bolling 10 posts 90 karma points
    Feb 09, 2016 @ 15:30
    Magnus Bolling
    0

    I'm having this very same issue in 7.2.6. The labels DataValue is 02501 but it's Value is stripped to 2501 when running:

    x.GetPropertyValue<string>("articleNumber")
    
  • Joss 10 posts 73 karma points
    Feb 10, 2016 @ 12:54
    Joss
    0

    I have submitted a ticket. Please help vote it up. http://issues.umbraco.org/issue/U4-7929

Please Sign in or register to post replies

Write your reply to:

Draft