When a new revision is being replicated to a workspace, if the uuid filter is being used, you get a fatal error Fatal error: Call to a member function hasTranslation() on null in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php
Drupal 8.1.8
Replication/workspace/multiversion/etc latest dev
Here's a test using devel execute php code:
use Drupal\replication\Entity\ReplicationLogInterface;
use Drupal\replication\ReplicationTask\ReplicationTask;
use Drupal\node\Entity\Node;
$workspace_manager = \Drupal::service('workspace.manager');
$live= $workspace_manager->loadByMachineName('live');
$stage = $workspace_manager->loadByMachineName('stage');
$workspace_manager->setActiveWorkspace($stage);
$live_pointer = reset(\Drupal::service('entity_type.manager')->getStorage('workspace_pointer')->loadByProperties(['workspace_pointer' => $live->id()]));
$stage_pointer = reset(\Drupal::service('entity_type.manager')->getStorage('workspace_pointer')->loadByProperties(['workspace_pointer' => $stage->id()]));
$node_a = Node::create([
'type' => 'page',
'title' => 'test a',
'body' => 'test a',
], 'node');
$node_a->save();
$response = \Drupal::service('workspace.replicator_manager')->update($stage_pointer, $live_pointer);
kint($response);
$workspace_manager->setActiveWorkspace($stage);
$node_a->save();
$task = new ReplicationTask();
$task->setFilter('uuid');
$task->setParameter('uuids', [$node_a->uuid()]);
$response = \Drupal::service('workspace.replicator_manager')->update($stage_pointer, $live_pointer , $task);
kint($response);
The error occurs in the 2nd update() call.
Comments
Comment #2
jeqq commentedComment #9
jeqq commentedAssigning to the correct module.
Comment #13
jeqq commentedTests won't pass because the branch is failing.
Comment #14
JamesK commentedThanks jeqq!
Comment #16
jeqq commented