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

Error when moving property types #6

Open w00kie-n00kie opened 10 years ago

w00kie-n00kie commented 10 years ago

Recieved an error when moving a property from a parent to a child. ie create a property in doc type and sync, then edit the code and move the property to a child doc type.

The error is in file : Vega.USiteBuilder.ManagerBase Will error on line 178 or 184 (depends upon whether there is a tab declared or not).

Code on lines

178 - contentType.MovePropertyType(propertyType.Alias, propAttr.TabAsString); 184 - contentType.MovePropertyType(propertyType.Alias, null);

Basically the propertyType is null. Debugged the code and it looks like the PropertyType is not being correctly added to the ContentType (its listed in the CompositionPropertyTypes but not the PropertyTypes).

spopovic commented 10 years ago

Hi @Steve-Brewer,

We will push a change today which will be detecting this scenario and preventing the error/exception to appear.

On the other hand, we can't really support moving of properties from a parent to a child doc type because such operation is not supported by Umbraco CMS. If you go to the CMS, create a property on a doc type and then try to create the same one on a child doc type, you'll not be able to do that.

One thing that we could theoretically do is to delete the property from the parent and then add it to the child doc type but that would be against the basic rules of uSiteBuilder - it never deletes doc types, properties, etc.

We would suggest that in case when you want to move a property from a parent doc type to its child doc type, you:

  1. delete the property from the class of the parent doc type
  2. go to the CMS and manually delete the property from the parent doc type
  3. add the property to the child doc type.

New commit/push will be done in next half an hour or so.

Regards, Sasa