vegaitglobal / uSiteBuilder

Vega IT’s uSitebuilder is an open source (LPGL) framework created for .NET developers to accelerate and streamline their Umbraco based development projects. Our objective is to enable back-end developers to adhere to the .NET standards with minimal external interaction, and to facilitate the automation of their deployments.
GNU Lesser General Public License v2.1
29 stars 21 forks source link

DataType Pre-Values get re-added, breaking all loaded content #4

Closed Myster closed 10 years ago

Myster commented 10 years ago

Given the following example: Every time the datatypes sync the pre-values get re-added to the DB, causing the IDs to change, and existing content to become corrupt. The same issue occurs with DropDownLists and other datatypes where the content saves the prevalue primary key.

namespace Example.UmbracoWebsite.DataTypes
{
    [DataType(Name = "Approved Color", UniqueId = "0225af17-b302-49cb-9176-b9f35cab9c17", RenderControlGuid = "f8d60f68-ec59-4974-b43b-c46eb5677985", DatabaseDataType = DBTypes.Nvarchar)]
    public partial class ApprovedColor : DataTypeBase
    {
        public override DataTypePrevalue[] Prevalues
        {
            get
            {
                return new DataTypePrevalue[]
                {
                    new DataTypePrevalue("", "eeeeee"),
                    new DataTypePrevalue("", "7fffd4"),
                    new DataTypePrevalue("", "ff00ff")
                };
            }
        }
    }
}
JimBobSquarePants commented 10 years ago

Any update on this?

spopovic commented 10 years ago

We'll try to fix it this week.

spopovic commented 10 years ago

@JimBobSquarePants, should be fixed now.

JimBobSquarePants commented 10 years ago

Awesome... Was gonna have a go myself but not had the chance. :+1:

spopovic commented 10 years ago

@JimBobSquarePants, did you have a chance to check it? Can we close the issue now?

JimBobSquarePants commented 10 years ago

I've not had a chance to test yet. Code looks sensible though, I'll update as soon as I can. I say close for now as I'm sure you conducted tests. We can always reopen.

Myster commented 10 years ago

I haven't tried this, but I did look at the commit 27487d3, I've put a note there