Problem/Motivation

As per current routing system if we add any URL with more than 10 slash ('/'), it throws page not found.

Steps to reproduce:

1. Create a path in your module_name.routing.yml with more than 10 slashes. for example:

foo_bar:
  pattern: 'a/b/c/d/e/f/g/h/i/j/k/l'
  defaults:
    _controller: '\Drupal\[module_name]\Controller\FooController::barPage'
  requirements:
    _access: 'TRUE'

2. Visit the page (i.e. a/b/c/d/e/f/g/h/i/j/k/l), throws 'page not found'

3. Remove few parts of the path and clear cache and try to visit the page (e.g. a/b/c/d/e/f/g/h/i), works fine.

Proposed resolution

Discuss.

#2028137: Integrate field configuration translation on the user interface

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Issue summary: View changes

Updated issue summary.

Gábor Hojtsy’s picture

Issue tags: +D8MI, +language-config

Yeah this makes it impossible to put further level subtasks on fields, so we cannot put the translate operation on fields :/

claudiu.cristea’s picture

Here's patch containing only tests that are confirming this.

claudiu.cristea’s picture

Status: Active » Needs review
Issue tags: +language-config

Sorry. seems I removed some tags

Status: Needs review » Needs work

The last submitted patch, drupal-long-routes-only-test-2035877-8.patch, failed testing.

claudiu.cristea’s picture

Paths are limited to 9 parts in both new and legacy routing systems:

$ grep -nr MAX_PARTS core
core/includes/menu.inc:277:const MENU_MAX_PARTS = 9;
core/includes/menu.inc:479:    $parts = array_slice($original_map, 0, MENU_MAX_PARTS);
core/includes/menu.inc:1732:  // Note - the number of empty elements should be > MENU_MAX_PARTS.
core/includes/menu.inc:3018:  $parts = explode('/', $link_path, MENU_MAX_PARTS);
core/includes/menu.inc:3060:    $parts = explode('/', $path, MENU_MAX_PARTS);
core/lib/Drupal/Core/Routing/MatcherDumper.php:23:  const MAX_PARTS = 9;
core/lib/Drupal/Core/Routing/RouteCompiler.php:22:  const MAX_PARTS = 9;
core/lib/Drupal/Core/Routing/RouteCompiler.php:96:    $parts = explode('/', trim($path, '/'), static::MAX_PARTS);
core/lib/Drupal/Core/Routing/RouteProvider.php:245:    }), 0, MatcherDumper::MAX_PARTS);
core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php:481:        $this->parts = explode('/', $this->link_path, MENU_MAX_PARTS);

It's something related to menu links but I didn't had time to investigate exactly what.

Here's a discussion related to this decision taken in D6 https://drupal.org/node/274270. Maybe @Gábor Hojtsy knows more as he was branch maintainer.

amateescu’s picture

The relevant answer is exactly in that issue :) #274270-1: Future of menu depth? Increasing the limit would mean that we need more pX columns in the {menu_links} table.

vijaycs85’s picture

Status: Needs work » Closed (duplicate)

Thanks @amateescu. Surely, duplicate of #274270: Future of menu depth?

claudiu.cristea’s picture

Seems that "pX columns" are kept in the same table for performance reasons. It would be nice to perform a benchmark comparing the actual implementation versus storing them in a separate table (mlid, delta, value). I'm not sure that releasing the "9 limit" by storing them in other table will have a big impact on performance.

Damien Tournoud’s picture

core/includes/menu.inc:277:const MENU_MAX_PARTS = 9;
core/lib/Drupal/Core/Routing/MatcherDumper.php:23:  const MAX_PARTS = 9;
core/lib/Drupal/Core/Routing/RouteCompiler.php:22:  const MAX_PARTS = 9;
core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php:481:        $this->parts = explode('/', $this->link_path, MENU_MAX_PARTS);

Seems like some clean-up is in order too.

Pancho’s picture

Pancho’s picture

Issue tags: -D8MI, -language-config

Retroactively untagging. This is not language related.

Gábor Hojtsy’s picture

Issue tags: +D8MI, +language-config

Please let the D8MI team track issues that block our efforts. As is with the explained situation, we need to opt to use GET arguments in config translation URLs due to this limitation, instead of relying on path parts and using the standard routing system, we need to work around it in a module proposed for core. I think that is plenty reason to track this on D8MI.

Pancho’s picture

Sorry... :)

Pancho’s picture

Issue summary: View changes

Update