diff --git a/src/Controller/TrashDeleteController.php b/src/Controller/TrashDeleteController.php
index ae5910a..f3971ed 100644
--- a/src/Controller/TrashDeleteController.php
+++ b/src/Controller/TrashDeleteController.php
@@ -78,23 +78,27 @@ class TrashDeleteController extends ControllerBase {
   /**
    * Delete an entity.
    *
-   * @return \Drupal\Core\Url
-   *   Returns the redirect url object.
+   * @return \Symfony\Component\HttpFoundation\RedirectResponse|array
+   *   Returns the redirect response if the entity is moderateable, otherwise
+   *   the delete form of the entity.
    */
   public function entityDelete() {
-    $parameters = $this->routeMatch->getParameters();
-    /** @var ContentEntityInterface $entity */
-    $entity = current(reset($parameters));
+    $parameters = $this->routeMatch->getParameters()->all();
+
+    $entities = array_filter($parameters, function ($parameter) {
+      return $parameter instanceof ContentEntityInterface;
+    });
+    $entity = reset($entities);
 
     if (!$this->moderationInformation->isModeratedEntity($entity)) {
       return $this->entityFormBuilder->getForm($entity, 'delete');
     }
 
-    $entity->moderation_state->target_id = 'archived';
+    $entity->get('moderation_state')->target_id = 'archived';
     if ($entity->save()) {
       drupal_set_message(t('The @entity %label has been moved to the trash.', [
         '@entity' => $entity->getEntityType()
-          ->get('label'),
+          ->getLabel(),
         '%label' => $entity->label(),
       ]));
     }
