Skip to content
Snippets Groups Projects
Commit 30c31175 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

Issue #2298993 by alexpott, tim.plunkett: Fixed routes using _entity_list...

Issue #2298993 by alexpott, tim.plunkett: Fixed routes using _entity_list wrongly are marked for upcasting.
parent 4baeb8d8
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -136,8 +136,7 @@ protected function setParametersFromReflection(array $controller, Route $route) ...@@ -136,8 +136,7 @@ protected function setParametersFromReflection(array $controller, Route $route)
/** /**
* Sets the upcasting information using the _entity_* route defaults. * Sets the upcasting information using the _entity_* route defaults.
* *
* Supported are the '_entity_view', '_entity_list' and '_entity_form' route * Supports the '_entity_view' and '_entity_form' route defaults.
* defaults.
* *
* @param \Symfony\Component\Routing\Route $route * @param \Symfony\Component\Routing\Route $route
* The route object. * The route object.
...@@ -146,9 +145,6 @@ protected function setParametersFromEntityInformation(Route $route) { ...@@ -146,9 +145,6 @@ protected function setParametersFromEntityInformation(Route $route) {
if ($entity_view = $route->getDefault('_entity_view')) { if ($entity_view = $route->getDefault('_entity_view')) {
list($entity_type) = explode('.', $entity_view, 2); list($entity_type) = explode('.', $entity_view, 2);
} }
elseif ($entity_list = $route->getDefault('_entity_list')) {
$entity_type = $entity_list;
}
elseif ($entity_form = $route->getDefault('_entity_form')) { elseif ($entity_form = $route->getDefault('_entity_form')) {
list($entity_type) = explode('.', $entity_form, 2); list($entity_type) = explode('.', $entity_form, 2);
} }
...@@ -194,7 +190,7 @@ public function setRouteOptions(Route $route) { ...@@ -194,7 +190,7 @@ public function setRouteOptions(Route $route) {
} }
} }
// Try to use _entity_view, _entity_list information on the route. // Try to use _entity_* information on the route.
$this->setParametersFromEntityInformation($route); $this->setParametersFromEntityInformation($route);
} }
......
...@@ -327,7 +327,7 @@ public function testSetRouteOptionsWithEntityListRoute() { ...@@ -327,7 +327,7 @@ public function testSetRouteOptionsWithEntityListRoute() {
$this->entityResolverManager->setRouteOptions($route); $this->entityResolverManager->setRouteOptions($route);
$this->assertEquals($defaults, $route->getDefaults()); $this->assertEquals($defaults, $route->getDefaults());
$parameters = $route->getOption('parameters'); $parameters = $route->getOption('parameters');
$this->assertEquals(array('entity_test' => array('type' => 'entity:entity_test')), $parameters); $this->assertNull($parameters);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment