if ($insert) {
$logger->notice('@type: added %info.', $context);
- drupal_set_message($this->t('@type %info has been created.', $t_args));
+ $this->messenger()->addStatus($this->t('@type %info has been created.', $t_args));
}
else {
$logger->notice('@type: updated %info.', $context);
- drupal_set_message($this->t('@type %info has been updated.', $t_args));
+ $this->messenger()->addStatus($this->t('@type %info has been updated.', $t_args));
}
if ($block->id()) {
else {
// In the unlikely case something went wrong on save, the block will be
// rebuilt and block form redisplayed.
- drupal_set_message($this->t('The block could not be saved.'), 'error');
+ $this->messenger()->addError($this->t('The block could not be saved.'));
$form_state->setRebuild();
}
}