replaced deprecated functions

This commit is contained in:
2021-11-27 15:19:16 +00:00
parent 3458949bb0
commit d4e8991804
16 changed files with 23 additions and 23 deletions

View File

@ -48,19 +48,19 @@ class OCActorForm extends ContentEntityForm {
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created %label.', [
\Drupal::messenger()->addMessage($this->t('Created %label.', [
'%label' => $entity->label(),
]));
break;
default:
drupal_set_message($this->t('Saved %label.', [
\Drupal::messenger()->addMessage($this->t('Saved %label.', [
'%label' => $entity->label(),
]));
}
// If you have unpublished the entity and you can't see unpublished entities, redirect to a more informative message than just "Access Denied".
if (!$form_state->getValue('status')['value'] && !\Drupal::currentUser()->hasPermission('view unpublished actor entities')) {
drupal_set_message($this->t('The record for "%label" is now unpublished & hidden from you.', [
\Drupal::messenger()->addMessage($this->t('The record for "%label" is now unpublished & hidden from you.', [
'%label' => $entity->label(),
]));
$form_state->setRedirect('<front>');