Closed (fixed)
Project:
Multiversion
Version:
8.x-1.x-dev
Component:
Miscellaneous
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
5 Nov 2015 at 13:55 UTC
Updated:
23 May 2017 at 14:19 UTC
Jump to comment: Most recent
We need to decide what happens when a Workspace config entity is deleted. Should it automatically remove all content in the Workspace as well?
Should the Workspace define all its content as dependencies?
etc.
Comments
Comment #2
dixon_Comment #3
stevectorThis scenario seems like an appropriate place for the "trash" concept. When a workspace is deleted, all of the content entities could be moved to the trash.
Comment #4
dixon_The issue with that approach is; content always have to belong to a workspace, even in the Trash bin. I honestly think we should be purging all content in a workspace when a workspace is deleted. It's essentially the equivalent to dropping a database in MySQL (all content in the DB vanish) or dropping a database in CouchDB (all documents vanish).
Comment #5
stevectorHmm, now that Workspaces are back to content entities, they themselves are "trashable," yes? I think it is fine for the rest of the content entities to follow the workspace. If a workspace is in the trash, all of its content entities would be trash. When the workspace is purged all of the related content entities are purged too. I think I'm agreeing with you :)
Comment #6
dixon_Actually, we would run into very strange inception problems if Multiversion would manage revisions on Workspaces the same way we manage revisions on other content entities. It might be possible, but it's a rabbit hole we haven't approached yet. So for now Workspaces are actually managed by the original/default core revisioning system, via this flag:
https://github.com/dickolsson/drupal-multiversion/blob/8.x-1.x/src/Entit...
...which is checked for here:
https://github.com/dickolsson/drupal-multiversion/blob/8.x-1.x/src/Multi...
Comment #7
dixon_Comment #8
timmillwoodPushed an initial fix for this.
Workspaces can now be deleted (as long as they're not the default or active workspace). There are "Delete own workspace" and "Delete any workspace" permissions.
Workspace pointer entities are deleted if they exist for the deleted workspace.
A list of delete workspace IDs are stored in the state system so we can go back in a later update (via cron) and delete entities for that workspace.
Comment #9
timmillwoodAdded a QueueWorker.
When a workspace is deleted the IDs of all the entities in that workspace get added to the queue, each cron run a few are deleted.