Drupal 6: maximum number of path elements is limited to 7

Submitted by Jochus on Wed, 19/01/2011 - 23:45 | Posted in: Drupal

The maximum number of path elements is limited to 7 in Drupal 6. This configuration is set in the variable: MENU_MAX_PARTS: http://api.drupal.org/api/drupal/includes--menu.inc/constant/MENU_MAX_P….

This means, that the following menu item will work:

$items['admin/settings/foo/bar/www/drupal/org'] = array(

... but this menu item will not work:

$items['admin/settings/foo/bar/www/drupal/org/jochen'] = array(

This variable is used in the menu.inc and is used to get pieces out of the part (for building menu paths):

function _menu_router_build($callbacks) {
  // First pass: separate callbacks from paths, making paths ready for
  // matching. Calculate fitness, and fill some default values.
  $menu = array();
  foreach ($callbacks as $path => $item) {
    $load_functions = array();
    $to_arg_functions = array();
    $fit = 0;
    $move = FALSE;
    $parts = explode('/', $path, MENU_MAX_PARTS);

But I cannot find a reason why they limit this explode function ... ?

Add new comment

The content of this field is kept private and will not be shown publicly.


  • Lines and paragraphs break automatically.
  • You can caption images (data-caption="Text"), but also videos, blockquotes, and so on.
  • Web page addresses and email addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <cpp>, <css>, <html5>, <java>, <javascript>, <php>, <sql>, <xml>. The supported tag styles are: <foo>, [foo].
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.