Closed wilr closed 4 years ago
Right so I've found a few reasons why. It looks like this was a toggle in 3 which is no longer available. In my mind unpublished records (not archived) should still appear. Or should we have this toggle ala 4?
Versioned::augmentSQLVersioned
does not include unpublished records so would need to be updated. Line 611. -$query->addWhere(["\"{$baseTable}_Versions\".\"WasDeleted\"" => 0]);
+$query->addWhere(
"\"{$baseTable}_Versions\".\"WasDeleted\" = 0 OR (".
"\"{$baseTable}_Versions\".\"WasDeleted\" = 1 AND ".
"\"{$baseTable}_Versions\".\"WasDraft\" = 0".
")"
);
DataObjectScaffolderExtension
needs to pass the WasDraft option.
Then all the UI needs to be updated (HistoryViewerVersionState) from versioned-admin
It would definitely be good to have Unpublished records in history. I cannot think of any UX reason why we wouldn't want it in History.
Yeah I'd say that's unintended behaviour. Unpublishing should create a new version to record this activity, and hence should show as a new entry there.
Changing the behaviour of Versioned::augmentSQLVersioned()
could be considered an API change though. You could imagine devs building logic on versioned behaviour, e.g. a task which deletes older versions that now behaves differently. Since a lot of this kicks in behind the scenes, it's really hard to tell how those APIs are used. Maybe we can modify the behaviour of a specific Versioned::augmentSQLVersioned<variation>()
variation and limit the impact?
There's an existing issue capturing designs and further detail of implementing a toggle here: https://github.com/silverstripe/silverstripe-versioned/issues/105
@wilr We might leave the fix of this to implemeting the https://github.com/silverstripe/silverstripe-versioned-snapshots module. You can review the epic here: https://github.com/silverstripe/silverstripe-versioned/issues/68 (make sure you have the Zenhub browser extension installed to see the cards linked to it). @newleeland will update the designs on there soon
It was decided that this work would be undertaken as a part of experience improvements work. Separate to the snapshots.
In addition Saved, Published we should also log records after a page has been:
F
Travis kitchen-sink is green with unmerged PR's https://travis-ci.org/github/creative-commoners/cwp-recipe-kitchen-sink/builds/717113255
Linked PR's have all been merged
Steps to reproduce in 4.4
When viewing the History tab you can only see 'Published' and 'Saved' no where is it clear that a page has been 'Unpublished' and when.
Before I submit a PR - is this intended behaviour? Was there a reason that this is not available?
Pull Requests