diff --git a/src/Form/Matcher/AddForm.php b/src/Form/Matcher/AddForm.php index fdc80f077091c0256150beb78f5b2dc848c1b9c4..5007d0475bedeb8924c527aa8c2be85b723a1055 100644 --- a/src/Form/Matcher/AddForm.php +++ b/src/Form/Matcher/AddForm.php @@ -120,7 +120,7 @@ class AddForm extends FormBase { ]); } else { - drupal_set_message($this->t('Added %label matcher.', ['%label' => $plugin->getLabel()])); + $this->messenger()->addMessage($this->t('Added %label matcher.', ['%label' => $plugin->getLabel()])); $form_state->setRedirect('linkit.matchers', [ 'linkit_profile' => $this->linkitProfile->id(), diff --git a/src/Form/Matcher/DeleteForm.php b/src/Form/Matcher/DeleteForm.php index e09b038e0614db3788a22a4f6208391f9365d8cd..e2f14ecb2e5fda091a491e9893385e8ca27614df 100644 --- a/src/Form/Matcher/DeleteForm.php +++ b/src/Form/Matcher/DeleteForm.php @@ -70,7 +70,7 @@ class DeleteForm extends ConfirmFormBase { public function submitForm(array &$form, FormStateInterface $form_state) { $this->linkitProfile->removeMatcher($this->linkitMatcher); - drupal_set_message($this->t('The matcher %label has been deleted.', ['%label' => $this->linkitMatcher->getLabel()])); + $this->messenger()->addMessage($this->t('The matcher %label has been deleted.', ['%label' => $this->linkitMatcher->getLabel()])); $this->logger('linkit')->notice('The matcher %label has been deleted in the @profile profile.', [ '%label' => $this->linkitMatcher->getLabel(), '@profile' => $this->linkitProfile->label(), diff --git a/src/Form/Matcher/EditForm.php b/src/Form/Matcher/EditForm.php index ef32d4a95b6b39673e70e680d6520d5ff2d7d042..d847d4e57cb2a379db4479bbfdaf0dc0c11e74b1 100644 --- a/src/Form/Matcher/EditForm.php +++ b/src/Form/Matcher/EditForm.php @@ -74,7 +74,7 @@ class EditForm extends FormBase { $this->linkitMatcher->submitConfigurationForm($form, $plugin_data); $this->linkitProfile->save(); - drupal_set_message($this->t('Saved %label configuration.', ['%label' => $this->linkitMatcher->getLabel()])); + $this->messenger()->addMessage($this->t('Saved %label configuration.', ['%label' => $this->linkitMatcher->getLabel()])); $this->logger('linkit')->notice('The matcher %label has been updated in the @profile profile.', [ '%label' => $this->linkitMatcher->getLabel(), '@profile' => $this->linkitProfile->label(), diff --git a/src/Form/Profile/FormBase.php b/src/Form/Profile/FormBase.php index 7670a42a98b707edb26f02d238c92ae36698e9dc..d11e33c0c0763b057ca5ad826af8744c5540179a 100644 --- a/src/Form/Profile/FormBase.php +++ b/src/Form/Profile/FormBase.php @@ -67,7 +67,7 @@ abstract class FormBase extends EntityForm { $edit_link = $this->entity->toLink($this->t('Edit'), 'edit-form')->toString(); switch ($status) { case SAVED_NEW: - drupal_set_message($this->t('Created new profile %label.', ['%label' => $linkit_profile->label()])); + $this->messenger()->addMessage($this->t('Created new profile %label.', ['%label' => $linkit_profile->label()])); $this->logger('linkit')->notice('Created new profile %label.', ['%label' => $linkit_profile->label(), 'link' => $edit_link]); $form_state->setRedirect('linkit.matchers', [ 'linkit_profile' => $linkit_profile->id(), @@ -75,7 +75,7 @@ abstract class FormBase extends EntityForm { break; case SAVED_UPDATED: - drupal_set_message($this->t('Updated profile %label.', ['%label' => $linkit_profile->label()])); + $this->messenger()->addMessage($this->t('Updated profile %label.', ['%label' => $linkit_profile->label()])); $this->logger('linkit')->notice('Updated profile %label.', ['%label' => $linkit_profile->label(), 'link' => $edit_link]); $form_state->setRedirectUrl($linkit_profile->toUrl('edit-form')); break;