function _menu_update_parental_status

×

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/api.elmsln.org/includes/bootstrap.inc).
cis7 menu.inc _menu_update_parental_status($item, $exclude = FALSE)
cle7 menu.inc _menu_update_parental_status($item, $exclude = FALSE)
elmsmedia7 menu.inc _menu_update_parental_status($item, $exclude = FALSE)
icor7 menu.inc _menu_update_parental_status($item, $exclude = FALSE)
meedjum_blog7 menu.inc _menu_update_parental_status($item, $exclude = FALSE)
mooc7 menu.inc _menu_update_parental_status($item, $exclude = FALSE)

Checks and updates the 'has_children' status for the parent of a link.

Related topics

3 calls to _menu_update_parental_status()
menu_link_save in includes/menu.inc
Saves a menu link.
_menu_delete_item in includes/menu.inc
Deletes a single menu link.
_menu_link_move_children in includes/menu.inc
Updates the children of a menu link that is being moved.

File

includes/menu.inc, line 3503
API for the Drupal menu system.

Code

function _menu_update_parental_status($item, $exclude = FALSE) {
  // If plid == 0, there is nothing to update.
  if ($item['plid']) {
    // Check if at least one visible child exists in the table.
    $query = db_select('menu_links');
    $query->addField('menu_links', 'mlid');
    $query->condition('menu_name', $item['menu_name']);
    $query->condition('hidden', 0);
    $query->condition('plid', $item['plid']);
    $query->range(0, 1);
    if ($exclude) {
      $query->condition('mlid', $item['mlid'], '<>');
    }
    $parent_has_children = ((bool) $query->execute()->fetchField()) ? 1 : 0;
    db_update('menu_links')->fields(array('has_children' => $parent_has_children))->condition('mlid', $item['plid'])->execute();
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.