Copied to clipboard

Flag this post as spam?

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


  • Dan Soule 33 posts 194 karma points
    Apr 07, 2022 @ 17:24
    Dan Soule
    0

    Umbraco 8.18.2 Model.HasValue always true for new nodes

    Model.HasValue returns true for empty template items for nodes/documents created with Umbraco version 8.18.2
    Nodes created with earlier versions of Umbraco 8 Model.HasValue still works correctly based on the content or lack of content.

    Is there an alternative to Model.HasValue that I should be using? Or is there a way to find the new node/document in the database and clean up things there.

  • Dan Soule 33 posts 194 karma points
    Apr 07, 2022 @ 22:34
    Dan Soule
    100

    I found what I needed using the .Any() function as below

    var links = Model.Value<>>("requiredProductLinks"); if (links.Any()) {

    Related technology

    }

Please Sign in or register to post replies

Write your reply to:

Draft