Copied to clipboard

Flag this post as spam?

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


  • nojaf 91 posts 300 karma points
    May 12, 2014 @ 15:46
    nojaf
    0

    Empty XmlContent

    Hi,

    This is more of a informative question that an actual problem but I'm curios about something.

    I have a contentType Person with some properties say firstName, lastName and age. When I create a new Person in can verify this in the xml (umbraco.config) by looking it up. I find:

    <Person some-attributes-here>
     <age>25</age>
     <firstName>John</firstName>
     <lastName>Doe</lastName>
    </Person>
    

    When I forget the fill in the age, there is no empty age tag in the umbraco.config. The age tag just isn't there.

    Is there is particular reason for this? Plus if you would use an IPubishedContent and do a GetValue

    So why is this anyway?

  • Damian Green 452 posts 1433 karma points
    May 12, 2014 @ 17:01
    Damian Green
    0

    AFAIK its because it wont save what doesn't have a value.

    Did you publish the item or just save it?

    You can, however, make the property required to ensure there is a value entered by the content editor.

  • nojaf 91 posts 300 karma points
    May 13, 2014 @ 08:46
    nojaf
    0

    I actually didn't do anything. It's all hypothetically actual. Making it required would solve the problem, however there isn't a real problem here. It's just my curiosity.

  • Damian Green 452 posts 1433 karma points
    May 13, 2014 @ 11:00
    Damian Green
    0

    If you don't publish the cached content in the umbraco.config file wont get updated as its just updating a new revision on the umbraco node in the database - so the file will not change and have an age anyway (if you see what i mean).

Please Sign in or register to post replies

Write your reply to:

Draft