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.

CommentFileSizeAuthor
#2 issue_with_uuid_filter-2792617-2.patch612 bytesjeqq

Comments

JamesK created an issue. See original summary.

jeqq’s picture

Status: Active » Needs review
StatusFileSize
new612 bytes

Status: Needs review » Needs work

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

jeqq’s picture

Project: Replication » Multiversion
Status: Needs work » Needs review

Assigning to the correct module.

Status: Needs review » Needs work

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

The last submitted patch, 2: issue_with_uuid_filter-2792617-2.patch, failed testing.

jeqq’s picture

Tests won't pass because the branch is failing.

JamesK’s picture

Thanks jeqq!

  • jeqq committed 5521cc5 on 8.x-1.x
    Issue #2792617 by jeqq: Issue with uuid filter
    
jeqq’s picture

Status: Needs work » Closed (fixed)