Skip to content

Commit

Permalink
make sure the contact message is added for nodes that don't have any …
Browse files Browse the repository at this point in the history
…exempt users

before this change, if viewing an embargoed object that didn't have any exempt users, then the foreach loop wouldn't be run for the empty array and the message wouldn't be added.
  • Loading branch information
JojoVes committed Aug 18, 2020
1 parent e10507b commit ab6cdcd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Plugin/Block/EmbargoesEmbargoNotificationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ public function build() {
if ($user['target_id'] == \Drupal::currentUser()->id()) {
$embargo_info['user_exempt'] = TRUE;
}
else {
$contact_message = $t->translate(
$this->notificationMessage,
['@contact' => $this->adminMail]
);
}
}
if (!$embargo_info['user_exempt']) {
$contact_message = $t->translate(
$this->notificationMessage,
['@contact' => $this->adminMail]
);
}

$embargo_info['dom_id'] = Html::getUniqueId('embargo_notification');
Expand Down

0 comments on commit ab6cdcd

Please sign in to comment.