diff -u b/core/modules/taxonomy/src/TermListBuilder.php b/core/modules/taxonomy/src/TermListBuilder.php --- b/core/modules/taxonomy/src/TermListBuilder.php +++ b/core/modules/taxonomy/src/TermListBuilder.php @@ -31,36 +31,37 @@ */ public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) { return new static( - $container->get('redirect.destination'), $entity_type, - $container->get('entity.manager')->getStorage($entity_type->id()) + $container->get('entity.manager')->getStorage($entity_type->id()), + $container->get('redirect.destination') ); } /** * Constructs a new instance. * - * @param \Drupal\Core\Routing\RedirectDestinationInterface - * The redirect destination. * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type definition. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The entity storage class. + * @param \Drupal\Core\Routing\RedirectDestinationInterface + * The redirect destination. */ - public function __construct(RedirectDestinationInterface $redirect_destination, EntityTypeInterface $entity_type, EntityStorageInterface $storage) { - $this->entityTypeId = $entity_type->id(); - $this->storage = $storage; - $this->entityType = $entity_type; + public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, RedirectDestinationInterface $redirect_destination) { + parent::__construct($entity_type, $storage); + $this->redirectDestination = $redirect_destination; } /** * {@inheritdoc} */ - public function getOperations(EntityInterface $entity) { - $operations = parent::getOperations($entity); - foreach ($operations as &$operation) { - $operation['query']['destination'] = $this->redirectDestination->get(); + public function getDefaultOperations(EntityInterface $entity) { + $operations = parent::getDefaultOperations($entity); + + $destination = $this->redirectDestination->getAsArray(); + foreach ($operations as $key => $operation) { + $operations[$key]['query'] = $destination; } return $operations; @@ -70,7 +71,7 @@ * {@inheritdoc} */ public function render() { - throw new \BadMethodCallException('This list builder can only provide operations. It does not build lists.'); + throw new \LogicException('This list builder can only provide operations. It does not build lists.'); } }