diff --git a/core/modules/views/src/Plugin/views/field/EntityOperations.php b/core/modules/views/src/Plugin/views/field/EntityOperations.php index 79f6f19..3b3a1f0 100644 --- a/core/modules/views/src/Plugin/views/field/EntityOperations.php +++ b/core/modules/views/src/Plugin/views/field/EntityOperations.php @@ -91,6 +91,12 @@ public function buildOptionsForm(&$form, &$form_state) { */ public function render(ResultRow $values) { $entity = $this->getEntity($values); + + // Skip rendering if the entity doesn't even have a list builder. + if (!$this->entityManager->hasController($entity->getEntityTypeId(), 'list_builder')) { + return array(); + } + $operations = $this->entityManager->getListBuilder($entity->getEntityTypeId())->getOperations($entity); if ($this->options['destination']) { foreach ($operations as &$operation) { diff --git a/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php b/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php index 39b7b93..5c5a77d 100644 --- a/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php +++ b/core/modules/views/src/Tests/Plugin/views/field/EntityOperationsUnitTest.php @@ -9,7 +9,6 @@ use Drupal\Tests\UnitTestCase; use Drupal\views\Plugin\views\field\EntityOperations; use Drupal\views\ResultRow; -use Symfony\Component\HttpFoundation\ParameterBag; /** * @coversDefaultClass \Drupal\views\Plugin\views\field\EntityOperations