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

@ -55,19 +55,19 @@ class OCActivityForm extends ContentEntityForm {
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created the %bundle.', [
\Drupal::messenger()->addMessage($this->t('Created the %bundle.', [
'%bundle' => $entity->bundle(),
]));
break;
default:
drupal_set_message($this->t('Saved the %bundle.', [
\Drupal::messenger()->addMessage($this->t('Saved the %bundle.', [
'%bundle' => $entity->bundle(),
]));
}
// 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 activity entities')) {
drupal_set_message($this->t('The %bundle is now unpublished & hidden from you.', [
\Drupal::messenger()->addMessage($this->t('The %bundle is now unpublished & hidden from you.', [
'%bundle' => $entity->bundle(),
]));
$form_state->setRedirect('<front>');