function menu_link_children_relative_depth


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 menu_link_children_relative_depth($item)
cle7 menu_link_children_relative_depth($item)
elmsmedia7 menu_link_children_relative_depth($item)
icor7 menu_link_children_relative_depth($item)
meedjum_blog7 menu_link_children_relative_depth($item)
mooc7 menu_link_children_relative_depth($item)

Finds the depth of an item's children relative to its depth.

For example, if the item has a depth of 2, and the maximum of any child in the menu link tree is 5, the relative depth is 3.


$item: An array representing a menu link item.

Return value

The relative depth, or zero.

Related topics

3 calls to menu_link_children_relative_depth()
menu_link_save in includes/
Saves a menu link.
_book_parent_depth_limit in modules/book/book.module
Finds the depth limit for items in the parent select.
_menu_parent_depth_limit in modules/menu/menu.module
Find the depth limit for items in the parent select.


includes/, line 3432
API for the Drupal menu system.


function menu_link_children_relative_depth($item) {
  $query = db_select('menu_links');
  $query->addField('menu_links', 'depth');
  $query->condition('menu_name', $item['menu_name']);
  $query->orderBy('depth', 'DESC');
  $query->range(0, 1);

  $i = 1;
  $p = 'p1';
  while ($i <= MENU_MAX_DEPTH && $item[$p]) {
    $query->condition($p, $item[$p]);
    $p = 'p' . ++$i;

  $max_depth = $query->execute()->fetchField();

  return ($max_depth > $item['depth']) ? $max_depth - $item['depth'] : 0;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.