Skip to content
Snippets Groups Projects
Commit 2644090a authored by catch's avatar catch
Browse files

Issue #2036241 by Xano: Fixed Routing system cannot handle /foo/bar and /foo/{baz}.

parent e85f89c3
Branches
Tags
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
......@@ -246,7 +246,7 @@ protected function getRoutesByPath($path) {
$ancestors = $this->getCandidateOutlines($parts);
$routes = $this->connection->query("SELECT name, route FROM {" . $this->connection->escapeTable($this->tableName) . "} WHERE pattern_outline IN (:patterns) ORDER BY fit", array(
$routes = $this->connection->query("SELECT name, route FROM {" . $this->connection->escapeTable($this->tableName) . "} WHERE pattern_outline IN (:patterns) ORDER BY fit DESC", array(
':patterns' => $ancestors,
))
->fetchAllKeyed();
......
......@@ -260,8 +260,10 @@ function testOutlinePathMatchDefaultsCollision2() {
try {
$routes = $provider->getRouteCollectionForRequest($request);
$routes_array = $routes->all();
$this->assertEqual(count($routes), 2, 'The correct number of routes was found.');
$this->assertEqual(array('narf', 'poink'), array_keys($routes_array), 'Ensure the fitness was taken into account.');
$this->assertNotNull($routes->get('narf'), 'The first matching route was found.');
$this->assertNotNull($routes->get('poink'), 'The second matching route was found.');
$this->assertNull($routes->get('eep'), 'Noin-matching route was not found.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment