summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranon2018-11-10 02:21:38 (GMT)
committerEmil Stjerneman2018-11-10 02:21:38 (GMT)
commitbf05f5976553bb068adc5405e8e96efbacd4e347 (patch)
tree7d94ad91202364dd93da885dfb5237df5eac25e1
parent130487f155d3650df5137ec066f941e5af392de0 (diff)
Issue #3012739 by anon: Change drupal_set_message() to use the messanger
-rw-r--r--src/Form/Matcher/AddForm.php2
-rw-r--r--src/Form/Matcher/DeleteForm.php2
-rw-r--r--src/Form/Matcher/EditForm.php2
-rw-r--r--src/Form/Profile/FormBase.php4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/Form/Matcher/AddForm.php b/src/Form/Matcher/AddForm.php
index fdc80f0..5007d04 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 e09b038..e2f14ec 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 ef32d4a..d847d4e 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 7670a42..d11e33c 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;