A site uses Workspace/Replication/Multiversion to realise a "site-wide draft/approval" workflow. An Editor creates a new workspace, makes some changes to nodes, blocks etc and assigns the workspace to a "Needs Review" state. An Approver comes along and wishes to see clearly what changes have been made so she can review them before publishing the workspace to the Live workspace.

Proposed resolution

We would probably benefit from the following:

  1. Entity list - A list of all entities created/updated/deleted between a workspace and its upstream (with links: "View", "Diff" for each entity). This could be displayed in a "Changes" tab on the workspace entity itself, and we could also make a block showing changes for the Active workspace. Where the workspace has no upstream the tab/block would be hidden.
  2. Diff - View a diff for a single entity. This would probably be fairly straightforward as it would just link to the diff module's page choosing the right vids. If there are un-pulled upstream changes to one of the entities, we would be unable to show a diff until it is updated (but could display a message). (Of course, in that case, there would be a conflict anyway..)
  3. Workspace labelling - Just an idea - it might be nice to add Workspace names as labels on the node/123/tree page?
Members fund testing for the Drupal project. Drupal Association Learn more


jamsilver created an issue. See original summary.

jamsilver’s picture

Issue summary: View changes
Grimreaper’s picture


I am also interested in this feature for #2840581: Pull individual entities

Checking the code of the Deploy stack, I think what should be done is:

  • Add a method in the workspace/src/ReplicatorInterface.php to get the distant entities
  • Implements this method in:
    • workspace/src/InternalReplicator.php: seeing the code from the replicate method it should be similar
    • relaxed/src/CouchdbReplicator.php: that should be more complex because we also should add methods/classes/interfaces, etc. to the relaxedws library
Grimreaper’s picture


Here is a patch that add the method in the ReplicatorInterface.php.

Implements it in workspace/src/InternalReplicator.php and workspace/src/ReplicatorManager.php (I don't know why the manager has the same interface as the Replicator plugins/services)

For the CouchdbReplicator, currently I have only added the following code:

   * {@inheritdoc}
  public function getDiffEntities(WorkspacePointerInterface $source, WorkspacePointerInterface $target, $task = NULL) {
    return array();

I am currently using this patch in #2840581-2: Pull individual entities which provide a simple UI to see changes and import it. Currentky working with internal workspaces.

I will see to improve my UI and to implement a real getDiffEntities method for CouchDB.

Thanks for the review.

Grimreaper’s picture

See issue #2842379: Examine pending changes for the relaxed WS implementation.

Status: Needs review » Needs work

The last submitted patch, 4: workspace-examine_pending_changes-2817495-4.patch, failed testing.