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

dixon_ created an issue. See original summary.

dixon_’s picture

Priority: Normal » Major
stevector’s picture

This 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.

dixon_’s picture

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).

stevector’s picture

Hmm, 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 :)

dixon_’s picture

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...

dixon_’s picture

Priority: Major » Critical
timmillwood’s picture

Priority: Critical » Major

Pushed 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.

timmillwood’s picture

Status: Active » Fixed

Added 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.