replaced deprecated functions
This commit is contained in:
@ -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>');
|
||||
|
||||
Reference in New Issue
Block a user