Commit bf05f597 authored by anon's avatar anon Committed by anon

Issue #3012739 by anon: Change drupal_set_message() to use the messanger

parent 130487f1
......@@ -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(),
......
......@@ -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(),
......
......@@ -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(),
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment