Skip to content

Commit

Permalink
Merge pull request #13 from essexcountycouncil/fix/LP-90
Browse files Browse the repository at this point in the history
fix(LP-90): Use both content owner and sme fields
  • Loading branch information
Polynya authored Sep 25, 2024
2 parents 0fc8f2b + f0d68c7 commit 315aecf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Commands/ContentOwnership.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,16 @@ public function addServiceContactsToNodes() {
if (!$node->hasField('field_content_owner')) {
continue;
}
$content_owners = $node->get('field_content_owner')->referencedEntities();

$content_owners = [];
// Combine content owners of both types without duplication.
foreach ($node->get('field_content_owner')->referencedEntities() as $entity) {
$content_owners[$entity->id()] = $entity;
}
foreach ($node->get('field_content_sme')->referencedEntities() as $entity) {
$content_owners[$entity->id()] = $entity;
}

$count = 0;
foreach ($content_owners as $content_owner) {
$email = $content_owner->get('email')->value;
Expand Down

0 comments on commit 315aecf

Please sign in to comment.