diff --git a/src/Controller/TrashController.php b/src/Controller/TrashController.php index 2489cf042cf533c25484f4b38c2f24ed61394361..002290b14ecd433751bd0810647dac4e16bd5775 100644 --- a/src/Controller/TrashController.php +++ b/src/Controller/TrashController.php @@ -198,12 +198,12 @@ class TrashController extends ControllerBase implements ContainerInjectionInterf if ($entity_type->entityClassImplements(EntityPublishedInterface::class)) { $row['published'] = $this->t('Status'); } - if ($entity_type->entityClassImplements(RevisionLogInterface::class)) { - $row['revision_user'] = $this->t('Deleted by'); - } if ($this->isMultilingual && $entity_type->isTranslatable()) { $row['language'] = $this->t('Language'); } + if ($entity_type->entityClassImplements(RevisionLogInterface::class)) { + $row['revision_user'] = $this->t('Deleted by'); + } $row['deleted'] = $this->t('Deleted on'); $row['operations'] = $this->t('Operations'); return $row; @@ -254,16 +254,6 @@ class TrashController extends ControllerBase implements ContainerInjectionInterf $row['published'] = $entity->isPublished() ? $this->t('published') : $this->t('not published'); } - if ($entity_type->entityClassImplements(RevisionLogInterface::class)) { - assert($entity instanceof RevisionLogInterface); - $row['revision_user']['data'] = [ - '#theme' => 'username', - '#account' => $entity->getRevisionUser(), - ]; - } - - $row['deleted'] = $this->dateFormatter->format($entity->get('deleted')->value, 'short'); - if ($this->isMultilingual && $entity->getEntityType()->isTranslatable()) { if ($entity instanceof TranslatableInterface && $entity->isDefaultTranslation()) { $row['language'] = $this->t('<strong>@language_name (Original language)</strong>', [ @@ -276,6 +266,16 @@ class TrashController extends ControllerBase implements ContainerInjectionInterf } } + if ($entity_type->entityClassImplements(RevisionLogInterface::class)) { + assert($entity instanceof RevisionLogInterface); + $row['revision_user']['data'] = [ + '#theme' => 'username', + '#account' => $entity->getRevisionUser(), + ]; + } + + $row['deleted'] = $this->dateFormatter->format($entity->get('deleted')->value, 'short'); + $list_builder = $this->entityTypeManager->hasHandler($entity_type->id(), 'list_builder') ? $this->entityTypeManager->getListBuilder($entity_type->id()) : $this->entityTypeManager->createHandlerInstance(EntityListBuilder::class, $entity_type); diff --git a/src/Form/EntityRestoreForm.php b/src/Form/EntityRestoreForm.php index c722556631ea684f515bb49d49d98e7dc8e08bc5..1fa9d01f2be297501b5d55177be77207f4beb2cc 100644 --- a/src/Form/EntityRestoreForm.php +++ b/src/Form/EntityRestoreForm.php @@ -83,6 +83,7 @@ class EntityRestoreForm extends ContentEntityConfirmFormBase implements Workspac else { $language = $entity->language(); } + $form = parent::buildForm($form, $form_state); $translation_languages = $entity->getTranslationLanguages(FALSE); if (count($translation_languages) > 0) { diff --git a/trash.module b/trash.module index 5267d9d260b5743a770fa712b9916dbf76614953..6bc2a8811c3ecf67d51a7b3cc696be60774f792f 100644 --- a/trash.module +++ b/trash.module @@ -394,6 +394,7 @@ function trash_entity_operation_alter(array &$operations, EntityInterface $entit $url_options = [ 'language' => \Drupal::languageManager()->getCurrentLanguage(), + 'query' => \Drupal::destination()->getAsArray(), ]; // Remove all other operations for deleted entities.