function book_title_override_node_load

cis7 book_title_override.module book_title_override_node_load($nodes, $types)
cle7 book_title_override.module book_title_override_node_load($nodes, $types)
elmsmedia7 book_title_override.module book_title_override_node_load($nodes, $types)
icor7 book_title_override.module book_title_override_node_load($nodes, $types)
meedjum_blog7 book_title_override.module book_title_override_node_load($nodes, $types)
mooc7 book_title_override.module book_title_override_node_load($nodes, $types)

Implements hook_node_load().

File

sites/all/modules/elmsln_contrib/book_title_override/book_title_override.module, line 33

Code

function book_title_override_node_load($nodes, $types) {
  $result = db_query("SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid IN (:nids)", array(':nids' => array_keys($nodes)), array('fetch' => PDO::FETCH_ASSOC));
  foreach ($result as $record) {
    if ($nodes[$record['nid']]->title != $record['link_title']) {
      $nodes[$record['nid']]->book_title_override_title = $record['link_title'];
      $nodes[$record['nid']]->book_title_override_override = TRUE;
    }
  }
}
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.