Copied to clipboard

Flag this post as spam?

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


  • Angus 34 posts 128 karma points
    Mar 10, 2017 @ 02:23
    Angus
    0

    Property Order in Compositions (7.5.10)

    Hi,

    On upgrading from 7.4.2 to 7.5.10, properties in compositions are no longer displayed in the correct order: properties are not located next to their neighbours as defined in their repective composition document type, and order values set on the composition document type tabs does not preserve this order in the composed document. This is destroying existing back-end layouts!!

    Any help in resolving this issue would be very welcome.

    Thanks,

    A

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Mar 11, 2017 @ 09:56
    Marc Goodson
    0

    Hi Angus

    There is an open issue on problems viewing / sorting composition properties..

    http://issues.umbraco.org/issue/U4-6738

    It will be interesting to see if the upgrade has changed the value of 'sortOrder' for your properties (and the new crazy ordering is using them) or whether now it is ignoring the sortOrder value in the database, and ordering alphabetically or something less obvious.

    Select Alias,sortOrder from cmsPropertyType
    

    executed against the database will give you what the stored sortOrder values are for your particular properties.

    If these values do seem to match to the crazy order you are seeing then you can update a particular alias sortOrder value with:

    Update cmsPropertyType Set sortOrder = 5 where Alias = 'propertyAlias'
    

    regards

    Marc

  • Angus 34 posts 128 karma points
    Mar 13, 2017 @ 11:11
    Angus
    0

    Hi Marc, thanks for the info. re. the open issue.

    As far as I can tell, the order of properties within a composition document type is preserved. The problem appears to relate to a 'mixing' of properties from individual composition documents when the composed document is built, e.g.,

    Composition Doctype1: (Tab sort order 100)

    Label 1.1 (0)

    Prop1.1 (1)

    Label 1.2 (2)

    Prop 1.2 (3)

    Composition Doctype2: (Tab sort order 200)

    Label 2.1 (0)

    Prop2.1 (1)

    Composed Doctype Expected -

    Label 1.1 (0)

    Prop 1.1 (1)

    Label 1.2 (2)

    Prop 1.2 (3)

    Label 2.1 (0)

    Prop 2.1 (1)

    Composed Doctype Actual -

    Label 1.1 (0)

    Label 2.1 (0)

    Prop 1.1 (1)

    Prop 2.1 (1)

    Label 1.2 (2)

    Prop 1.2 (3)

    Angus

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Mar 13, 2017 @ 18:56
    Marc Goodson
    101

    Hi Angus

    Yes, that's where we are at with compositions and property sorting at the moment, as you can see from that issue.

    Basically when you have two compositions that have properties appearing on the same tab name, instead of ordering first by Tab Sort Order, and then by the Property Sort Order on that composition as you might intuitively expect, the properties are combined and then ordered by their sort order (across the compositions).

    So first property on DocType1 has a sort order of 0 and first property on DocType2 has a sort order of 0

    and so that first property on DocType2 appears before the second property on DocType1, because it's sort order is lower (even though that sort order is set within the context of the other doc type!!!)

    What I've ended up doing in this scenario is artificially making the sort order of the first property on the second doc type start at say 4, and the second property on the second doc type to have a sort order of 5 etc, this means you can control where they appear, when they are combined!!!

    it's a bit of a faff!

    The three main ways of doing it are to

    1) execute the update SQL above to explicity set the sort order for each property so that the merging works!

    or

    *2) if you are squamish about executing sql - add artificial label properties to the doc type composition which will increase the sort order value of the actual properties underneath, so adding 4 labels before the first property on the second doc type would endup giving that first property a sort order of 4 - then delete the labels properties the sort order will 'stick' at 4 for the first real property

    or

    *3) use uSync, uSync will export out to xml files on disc the definitions of all of your document types, (including sort order of properties) you can manually update them on disc, to have the increased numbers, and then import them back into Umbraco.

    But beware reordering the properties at a later date after these tricks will reset the order back to 0,1,2 etc - I tend to do this level of hacking at the end of a project or at least with uSync persist the changes to sort order to source control, so when they do change they can easily be reverted!

    regards

    Marc

  • Angus 34 posts 128 karma points
    Mar 13, 2017 @ 20:20
    Angus
    0

    Hi Marc,

    Thanks for the insight and an approach to fixing the issue: a couple of cmsPropertyType table updates and relocation of a property within its own tab has solved our immediate problem. (uSync is new to us but this is about to change!)

    Angus

Please Sign in or register to post replies

Write your reply to:

Draft