Copied to clipboard

Flag this post as spam?

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


  • Graham Roe 3 posts 23 karma points
    Apr 15, 2013 @ 11:59
    Graham Roe
    0

    Sorting Content Causes Property Values to Reset

    I have a documentType which includes a simple Boolean value. 

    I main it using two user controls: one where default the value should be False, and another where the default value should be True. They implement the umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor interface. A sample of the value logic is 

    get

    {

      return CheckBox1.Checked ? 1 : 0;

    }

     

    set

    {

      if (value.ToString() == "" || value.ToString() == "1")

      {

        CheckBox1.Checked = true;

      }

      else

      {

        CheckBox1.Checked = false;

      }

    }

     

    These are then created as custom datatypes, using the Umbraco Usercontrol wrapper. 

     

    Everything works fine, until I sort the content, at which point some of the content nodes have their property value reset to NULL. My user control isn’t called during the sort (no breakpoints trigger), so I think this seems to be a problem with the core behavior. However, I'd very warmly welcome any information that the bug lies with me!

     

    (I use the following SQL to check what’s happening with my property.)

     

    SELECT

             t.alias

           , pd.dataInt

           , pd.dataDate

           , pd.dataNvarchar

           , pd.dataNtext

           , n.text

           , n.level

    FROM

           cmsPropertyData AS pd

           INNER JOIN umbracoNode AS n ON n.id = pd.contentNodeId

           INNER JOIN cmsDocument AS d ON n.id = d.nodeId

           INNER JOIN cmsPropertyType AS t ON t.id = pd.propertytypeid

    WHERE

           d.newest = 1

           AND d.versionId = pd.versionId

           AND n.trashed = 0

           AND t.alias = 'myProperty'

     

    ;

     

     

     

  • Graham Roe 3 posts 23 karma points
    Apr 17, 2013 @ 17:43
    Graham Roe
    0

    This was in version 6.0.0. As there have been a lot of fixes around document type properties between 6.0.0 and 6.0.3, I'm upgrading to see if this solves the problem.

Please Sign in or register to post replies

Write your reply to:

Draft