🇸🇮Slovenia @jurecop

Account created on 1 July 2022, about 2 years ago
#

Recent comments

🇸🇮Slovenia jurecop

I solved this using the hook_cer_differences_alter, by filtering entities by field bundle:

hook_cer_differences_alter(\Drupal\Core\Entity\ContentEntityInterface $entity,
array &$differences, $correspondingField
): void {
$allowedFieldBundles = [
'field_bundle_type' => 'bundle_type',
];

if (!empty($differences['add'])) {
$hasKey = array_key_exists($correspondingField, $allowedFieldBundles);
if ($entity instanceof \Drupal\node\NodeInterface && $hasKey) {
$entityType = $entity->bundle();
if ($allowedFieldBundles[$correspondingField] !== $entityType) {
$differences = ['add' => [], 'remove' => []];
}
}
}
}

Production build 0.71.5 2024