Skip to content

Commit

Permalink
NBBIB-335 Only warn of unpublished merge if there are duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
camilocodes committed Sep 11, 2023
1 parent a1f21c1 commit e26e967
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions custom/modules/nbbib_core/src/Form/MergeContribsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ public function buildForm(array $form, FormStateInterface $form_state, $yabrm_co
}

if (count($results) > 1) {
if (!$pub) {
// Add unpublished contrib warning.
$warning = "
You are about to merge other contributors into unpublished contributor <i>$name</i>.
";

$form['warning'] = [
'#type' => 'markup',
'#markup' => $this->t("<b>WARNING:</b> $warning"),
];
}
// Add actions.
$form['actions']['#type'] = 'actions';

$form['actions']['submit'] = [
Expand All @@ -187,18 +199,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $yabrm_co
$this->t("No duplicate candidates found.");
}

if (!$pub) {
// Add unpublished contrib warning.
$warning = "
You are about to merge other contributors into unpublished contributor <i>$name</i>.
";

$form['warning'] = [
'#type' => 'markup',
'#markup' => $this->t("<b>WARNING:</b> $warning"),
];
}

return $form;
}

Expand Down

0 comments on commit e26e967

Please sign in to comment.