Message of the day:
Layout blocks: https://invis.io/VMDZ9YAGX#/294927507_Layout_Builder_-_Add_Layout_-menu- Background: https://docs.google.com/document/d/1hffZFknysYi6tp55eOk4DzON4pjoEt7Xq4GGD-ZGah0/edit
Discuss the future of content editing in SilverStripe via content blocks
I'm not hugely familier with ss4
many_many but i would think that all the "extraFields" objects that have the sort value need to be
owned by the parent object (saving the parent object and all the extrafields objects should be atomic)
- public function onAfterPublish()
- // Force live sort order to match stage sort order
- 'UPDATE "SiteTree_Live"
- SET "Sort" = (SELECT "SiteTree"."Sort" FROM "SiteTree" WHERE "SiteTree_Live"."ID" = "SiteTree"."ID")
- WHERE EXISTS (SELECT "SiteTree"."Sort" FROM "SiteTree" WHERE "SiteTree_Live"."ID" = "SiteTree"."ID") AND "ParentID" = ?',
Yep, I’m probably going to implement that hack for now. When publishing a element, update the sort of all sibling elements to the same values as stage as I need it to work for now. It looks like that is what SiteTree is doing atm
yea, that would be why you'd want the sort order to be part of the "parent" object. I'd want to do the same thing with the way SiteTree works, that would likely be a version bump, but i imagine it wouldn't be too different to having a one-off object like SiteConfig.
The only other way i can think of is bypassing the versioning system when reordering pages and writing directly to the live tables (in addition to the others) when reordering to keep them from getting 'corrupt' but i'd call that a hack