Copied to clipboard

Flag this post as spam?

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


  • Marc Goodson 2148 posts 14352 karma points MVP 8x c-trib
    Aug 23, 2012 @ 11:53
    Marc Goodson
    0

    Using a Package to Move and then update a datatype

    I'm wondering what the behaviour for this situation should be, and therefore whether this is a bug or a feature request.

    Basically if I create a new DataType in an installation of umbraco, for a simple dropdown of selectable items

    And then create a new Package, and deploy it to a new installation of umbraco somewhere else, then all is fine, and the DataType and prevalues are recreated in the other umbraco installation.

    However if I go back to the original Umbraco installation and add a new prevalue to the DataType, and create a new version of the package that includes the updated DataType and deploy it to the other umbraco installation, the additional prevalue is not added ? The package doesn't fail, there appear to be no errors.

    What should the behaviour be in this instance ?

    Should the updated package, add the new prevalues to the existing prevously installed DataType ?

    What if a prevalue is removed from the DataType ? Should the DataType prevalues synchronise ?? or

    Should the package delete the existing DataType and then recreate it with the same alias but new values ?

    What happens if the DataType is in use in a DocType, and a content node has selected a prevalue and this prevalue gets removed by the package update ??

    As I say just wondering what the expected behaviour should be in this scenario...

  • TechnoMan 11 posts 51 karma points
    May 10, 2013 @ 01:39
    TechnoMan
    0

    Hi,

    I am going through same problem. Did you find any solution to this?

     

    Amer

  • Marc Goodson 2148 posts 14352 karma points MVP 8x c-trib
    May 10, 2013 @ 11:44
    Marc Goodson
    0

    Hi Technoman

    The package code doesn't 'try' to sync the prevalues at all :-( if the data type already exists, 

    We tried different things exporting the package, changing it's datatype name in the package xml, which then creates a new datatype with the updated prevalues, and then we would change the property to use the new datatype, then delete and rename the imported  datatype.

    But this was fairly unworkable, you could also create a package action to tidy up and sync the prevalues after the package is installed (see http://our.umbraco.org/wiki/how-tos/packages-and-projects/package-action-samples), but we found it was just easier to manually sort out the prevalues after the package was installed,but then it became a pain and so...

    In our situation the prevalues list, happened to be a list of css class names, for the editor to choose to apply different styles to an element from a stylesheet, and so I created a package uCssClassNameDropdown, that allows you to point the data type to a stylesheet, with a regex to select the class names we need, now when the stylesheet gets updated with a new style, it automatically appears as a prevalue option in the datatype for the editor to select.

    You could do a similar thing by putting the prevalues in an xml file.

    It depends on whether your creating a package to move things around internally or for the package library...

    if that helps at all...:-)

Please Sign in or register to post replies

Write your reply to:

Draft