Skip to content
Snippets Groups Projects
Commit 987b7a83 authored by Robert Phillips's avatar Robert Phillips Committed by Thomas de Graaff
Browse files

Issue #3348337: Set syncing when updating reference fields

parent fe58a5af
No related branches found
No related tags found
1 merge request!8Issue #3348337: Set syncing when updating reference fields
......@@ -6,6 +6,7 @@ use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\SynchronizableInterface;
use Drupal\radioactivity\Entity\Radioactivity;
/**
......@@ -109,6 +110,9 @@ class RadioactivityReferenceUpdater implements RadioactivityReferenceUpdaterInte
}
if ($entityIsUpdated) {
if ($entity instanceof SynchronizableInterface) {
$entity->setSyncing(TRUE);
}
$entity->save();
}
......
......@@ -209,6 +209,7 @@ class RadioactivityReferenceUpdaterTest extends UnitTestCase {
$entity->getEntityTypeId()->willReturn('node');
$entity->bundle()->willReturn('article');
$entity->get('field_rar')->willReturn($fieldItemList);
$entity->setSyncing(TRUE)->willReturn(TRUE);
$entity->save()->shouldBeCalledTimes($entityIsUpdated ? 1 : 0);
// The return value of ::getReferenceFields are the configured fields
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment