Commit 4d46b7cd authored by webchick's avatar webchick

Roll-back of #595084; type-hinting parameters at stdClass makes it so you...

Roll-back of #595084; type-hinting parameters at stdClass makes it so you can't ever pass in another type of class.
parent 370d07e9
...@@ -50,14 +50,14 @@ function blog_help($path, $arg) { ...@@ -50,14 +50,14 @@ function blog_help($path, $arg) {
/** /**
* Implement hook_form(). * Implement hook_form().
*/ */
function blog_form(stdClass $node, $form_state) { function blog_form($node, $form_state) {
return node_content_form($node, $form_state); return node_content_form($node, $form_state);
} }
/** /**
* Implement hook_view(). * Implement hook_view().
*/ */
function blog_view(stdClass $node, $build_mode) { function blog_view($node, $build_mode) {
if ((bool)menu_get_object()) { if ((bool)menu_get_object()) {
// Breadcrumb navigation. // Breadcrumb navigation.
drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => format_username($node))), 'blog/' . $node->uid))); drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => format_username($node))), 'blog/' . $node->uid)));
...@@ -68,7 +68,7 @@ function blog_view(stdClass $node, $build_mode) { ...@@ -68,7 +68,7 @@ function blog_view(stdClass $node, $build_mode) {
/** /**
* Implement hook_node_view(). * Implement hook_node_view().
*/ */
function blog_node_view(stdClass $node, $build_mode = 'full') { function blog_node_view($node, $build_mode = 'full') {
if ($build_mode != 'rss') { if ($build_mode != 'rss') {
if ($node->type == 'blog' && arg(0) != 'blog' || arg(1) != $node->uid) { if ($node->type == 'blog' && arg(0) != 'blog' || arg(1) != $node->uid) {
$links['blog_usernames_blog'] = array( $links['blog_usernames_blog'] = array(
......
...@@ -116,7 +116,7 @@ class BlogTestCase extends DrupalWebTestCase { ...@@ -116,7 +116,7 @@ class BlogTestCase extends DrupalWebTestCase {
* @param integer $response * @param integer $response
* HTTP response code. * HTTP response code.
*/ */
private function verifyBlogs($node_user, stdClass $node, $admin, $response = 200) { private function verifyBlogs($node_user, $node, $admin, $response = 200) {
$crumb = '›'; $crumb = '›';
$quote = '''; $quote = ''';
......
...@@ -77,7 +77,7 @@ function book_admin_settings_validate($form, &$form_state) { ...@@ -77,7 +77,7 @@ function book_admin_settings_validate($form, &$form_state) {
* *
* @ingroup forms. * @ingroup forms.
*/ */
function book_admin_edit($form, $form_state, stdClass $node) { function book_admin_edit($form, $form_state, $node) {
drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']);
$form['#node'] = $node; $form['#node'] = $node;
_book_admin_table($node, $form); _book_admin_table($node, $form);
...@@ -151,7 +151,7 @@ function book_admin_edit_submit($form, &$form_state) { ...@@ -151,7 +151,7 @@ function book_admin_edit_submit($form, &$form_state) {
* *
* @see book_admin_edit() * @see book_admin_edit()
*/ */
function _book_admin_table(stdClass $node, &$form) { function _book_admin_table($node, &$form) {
$form['table'] = array( $form['table'] = array(
'#theme' => 'book_admin_table', '#theme' => 'book_admin_table',
'#tree' => TRUE, '#tree' => TRUE,
......
...@@ -63,7 +63,7 @@ function book_permission() { ...@@ -63,7 +63,7 @@ function book_permission() {
/** /**
* Inject links into $node as needed. * Inject links into $node as needed.
*/ */
function book_node_view_link(stdClass $node, $build_mode) { function book_node_view_link($node, $build_mode) {
$links = array(); $links = array();
if (isset($node->book['depth'])) { if (isset($node->book['depth'])) {
...@@ -177,14 +177,14 @@ function book_menu() { ...@@ -177,14 +177,14 @@ function book_menu() {
/** /**
* Menu item access callback - determine if the outline tab is accessible. * Menu item access callback - determine if the outline tab is accessible.
*/ */
function _book_outline_access(stdClass $node) { function _book_outline_access($node) {
return user_access('administer book outlines') && node_access('view', $node); return user_access('administer book outlines') && node_access('view', $node);
} }
/** /**
* Menu item access callback - determine if the user can remove nodes from the outline. * Menu item access callback - determine if the user can remove nodes from the outline.
*/ */
function _book_outline_remove_access(stdClass $node) { function _book_outline_remove_access($node) {
return isset($node->book) && ($node->book['bid'] != $node->nid) && _book_outline_access($node); return isset($node->book) && ($node->book['bid'] != $node->nid) && _book_outline_access($node);
} }
...@@ -439,7 +439,7 @@ function _book_parent_select($book_link) { ...@@ -439,7 +439,7 @@ function _book_parent_select($book_link) {
/** /**
* Build the common elements of the book form for the node and outline forms. * Build the common elements of the book form for the node and outline forms.
*/ */
function _book_add_form_elements(&$form, stdClass $node) { function _book_add_form_elements(&$form, $node) {
// Need this for AJAX. // Need this for AJAX.
$form['#cache'] = TRUE; $form['#cache'] = TRUE;
...@@ -520,7 +520,7 @@ function _book_add_form_elements(&$form, stdClass $node) { ...@@ -520,7 +520,7 @@ function _book_add_form_elements(&$form, stdClass $node) {
* Performs all additions and updates to the book outline through node addition, * Performs all additions and updates to the book outline through node addition,
* node editing, node deletion, or the outline tab. * node editing, node deletion, or the outline tab.
*/ */
function _book_update_outline(stdClass $node) { function _book_update_outline($node) {
if (empty($node->book['bid'])) { if (empty($node->book['bid'])) {
return FALSE; return FALSE;
} }
...@@ -736,7 +736,7 @@ function book_node_load($nodes, $types) { ...@@ -736,7 +736,7 @@ function book_node_load($nodes, $types) {
/** /**
* Implement hook_node_view(). * Implement hook_node_view().
*/ */
function book_node_view(stdClass $node, $build_mode) { function book_node_view($node, $build_mode) {
if ($build_mode == 'full') { if ($build_mode == 'full') {
if (!empty($node->book['bid']) && empty($node->in_preview)) { if (!empty($node->book['bid']) && empty($node->in_preview)) {
$node->content['book_navigation'] = array( $node->content['book_navigation'] = array(
...@@ -768,7 +768,7 @@ function book_page_alter(&$page) { ...@@ -768,7 +768,7 @@ function book_page_alter(&$page) {
/** /**
* Implement hook_node_presave(). * Implement hook_node_presave().
*/ */
function book_node_presave(stdClass $node) { function book_node_presave($node) {
// Always save a revision for non-administrators. // Always save a revision for non-administrators.
if (!empty($node->book['bid']) && !user_access('administer nodes')) { if (!empty($node->book['bid']) && !user_access('administer nodes')) {
$node->revision = 1; $node->revision = 1;
...@@ -786,7 +786,7 @@ function book_node_presave(stdClass $node) { ...@@ -786,7 +786,7 @@ function book_node_presave(stdClass $node) {
/** /**
* Implement hook_node_insert(). * Implement hook_node_insert().
*/ */
function book_node_insert(stdClass $node) { function book_node_insert($node) {
if (!empty($node->book['bid'])) { if (!empty($node->book['bid'])) {
if ($node->book['bid'] == 'new') { if ($node->book['bid'] == 'new') {
// New nodes that are their own book. // New nodes that are their own book.
...@@ -801,7 +801,7 @@ function book_node_insert(stdClass $node) { ...@@ -801,7 +801,7 @@ function book_node_insert(stdClass $node) {
/** /**
* Implement hook_node_update(). * Implement hook_node_update().
*/ */
function book_node_update(stdClass $node) { function book_node_update($node) {
if (!empty($node->book['bid'])) { if (!empty($node->book['bid'])) {
if ($node->book['bid'] == 'new') { if ($node->book['bid'] == 'new') {
// New nodes that are their own book. // New nodes that are their own book.
...@@ -816,7 +816,7 @@ function book_node_update(stdClass $node) { ...@@ -816,7 +816,7 @@ function book_node_update(stdClass $node) {
/** /**
* Implement hook_node_delete(). * Implement hook_node_delete().
*/ */
function book_node_delete(stdClass $node) { function book_node_delete($node) {
if (!empty($node->book['bid'])) { if (!empty($node->book['bid'])) {
if ($node->nid == $node->book['bid']) { if ($node->nid == $node->book['bid']) {
// Handle deletion of a top-level post. // Handle deletion of a top-level post.
...@@ -839,7 +839,7 @@ function book_node_delete(stdClass $node) { ...@@ -839,7 +839,7 @@ function book_node_delete(stdClass $node) {
/** /**
* Implement hook_node_prepare(). * Implement hook_node_prepare().
*/ */
function book_node_prepare(stdClass $node) { function book_node_prepare($node) {
// Prepare defaults for the add/edit form. // Prepare defaults for the add/edit form.
if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) { if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) {
$node->book = array(); $node->book = array();
...@@ -1086,7 +1086,7 @@ function book_export_traverse($tree, $visit_func) { ...@@ -1086,7 +1086,7 @@ function book_export_traverse($tree, $visit_func) {
* @return * @return
* The HTML generated for the given node. * The HTML generated for the given node.
*/ */
function book_node_export(stdClass $node, $children = '') { function book_node_export($node, $children = '') {
$build = node_build($node, 'print'); $build = node_build($node, 'print');
unset($build['#theme']); unset($build['#theme']);
// @todo Rendering should happen in the template using render(). // @todo Rendering should happen in the template using render().
......
...@@ -89,7 +89,7 @@ function book_export_html($nid) { ...@@ -89,7 +89,7 @@ function book_export_html($nid) {
/** /**
* Menu callback; show the outline form for a single node. * Menu callback; show the outline form for a single node.
*/ */
function book_outline(stdClass $node) { function book_outline($node) {
drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']);
return drupal_get_form('book_outline_form', $node); return drupal_get_form('book_outline_form', $node);
} }
...@@ -102,7 +102,7 @@ function book_outline(stdClass $node) { ...@@ -102,7 +102,7 @@ function book_outline(stdClass $node) {
* *
* @ingroup forms * @ingroup forms
*/ */
function book_outline_form($form, &$form_state, stdClass $node) { function book_outline_form($form, &$form_state, $node) {
if (!isset($node->book)) { if (!isset($node->book)) {
// The node is not part of any book yet - set default options. // The node is not part of any book yet - set default options.
$node->book = _book_link_defaults($node->nid); $node->book = _book_link_defaults($node->nid);
...@@ -186,7 +186,7 @@ function book_outline_form_submit($form, &$form_state) { ...@@ -186,7 +186,7 @@ function book_outline_form_submit($form, &$form_state) {
* *
* @ingroup forms * @ingroup forms
*/ */
function book_remove_form($form, &$form_state, stdClass $node) { function book_remove_form($form, &$form_state, $node) {
$form['#node'] = $node; $form['#node'] = $node;
$title = array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']); $title = array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']);
......
...@@ -94,7 +94,7 @@ class BookTestCase extends DrupalWebTestCase { ...@@ -94,7 +94,7 @@ class BookTestCase extends DrupalWebTestCase {
* @param $breadcrumb * @param $breadcrumb
* The nodes that should be displayed in the breadcrumb. * The nodes that should be displayed in the breadcrumb.
*/ */
function checkBookNode(stdClass $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) { function checkBookNode($node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) {
// $number does not use drupal_static as it should not be reset // $number does not use drupal_static as it should not be reset
// since it uniquely identifies each call to checkBookNode(). // since it uniquely identifies each call to checkBookNode().
static $number = 0; static $number = 0;
......
...@@ -423,7 +423,7 @@ function comment_get_recent($number = 10) { ...@@ -423,7 +423,7 @@ function comment_get_recent($number = 10) {
* @return * @return
* "page=X" if the page number is greater than zero; empty string otherwise. * "page=X" if the page number is greater than zero; empty string otherwise.
*/ */
function comment_new_page_count($num_comments, $new_replies, stdClass $node) { function comment_new_page_count($num_comments, $new_replies, $node) {
$mode = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED); $mode = variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED);
$comments_per_page = variable_get('comment_default_per_page_' . $node->type, 50); $comments_per_page = variable_get('comment_default_per_page_' . $node->type, 50);
$pagenum = NULL; $pagenum = NULL;
...@@ -483,7 +483,7 @@ function theme_comment_block() { ...@@ -483,7 +483,7 @@ function theme_comment_block() {
/** /**
* Implement hook_node_view(). * Implement hook_node_view().
*/ */
function comment_node_view(stdClass $node, $build_mode) { function comment_node_view($node, $build_mode) {
$links = array(); $links = array();
if ($node->comment) { if ($node->comment) {
...@@ -589,7 +589,7 @@ function comment_node_view(stdClass $node, $build_mode) { ...@@ -589,7 +589,7 @@ function comment_node_view(stdClass $node, $build_mode) {
* @param $node * @param $node
* A node object. * A node object.
*/ */
function comment_node_page_additions(stdClass $node) { function comment_node_page_additions($node) {
$additions = array(); $additions = array();
// Only attempt to render comments if the node has visible comments. // Only attempt to render comments if the node has visible comments.
...@@ -690,7 +690,7 @@ function comment_node_page_additions(stdClass $node) { ...@@ -690,7 +690,7 @@ function comment_node_page_additions(stdClass $node) {
* spoil the reverse ordering, "ORDER BY thread ASC" -- here, we do not need * spoil the reverse ordering, "ORDER BY thread ASC" -- here, we do not need
* to consider the trailing "/" so we use a substring only. * to consider the trailing "/" so we use a substring only.
*/ */
function comment_get_thread(stdClass $node, $mode, $comments_per_page) { function comment_get_thread($node, $mode, $comments_per_page) {
$query = db_select('comment', 'c')->extend('PagerDefault'); $query = db_select('comment', 'c')->extend('PagerDefault');
$query->addField('c', 'cid'); $query->addField('c', 'cid');
$query $query
...@@ -780,7 +780,7 @@ function comment_prepare_thread(&$comments) { ...@@ -780,7 +780,7 @@ function comment_prepare_thread(&$comments) {
* @return * @return
* An array as expected by drupal_render(). * An array as expected by drupal_render().
*/ */
function comment_build($comment, stdClass $node, $build_mode = 'full') { function comment_build($comment, $node, $build_mode = 'full') {
// Populate $comment->content with a render() array. // Populate $comment->content with a render() array.
comment_build_content($comment, $node, $build_mode); comment_build_content($comment, $node, $build_mode);
...@@ -836,7 +836,7 @@ function comment_build($comment, stdClass $node, $build_mode = 'full') { ...@@ -836,7 +836,7 @@ function comment_build($comment, stdClass $node, $build_mode = 'full') {
* @param $build_mode * @param $build_mode
* Build mode, e.g. 'full', 'teaser'... * Build mode, e.g. 'full', 'teaser'...
*/ */
function comment_build_content($comment, stdClass $node, $build_mode = 'full') { function comment_build_content($comment, $node, $build_mode = 'full') {
// Remove previously built content, if exists. // Remove previously built content, if exists.
$comment->content = array(); $comment->content = array();
...@@ -873,7 +873,7 @@ function comment_build_content($comment, stdClass $node, $build_mode = 'full') { ...@@ -873,7 +873,7 @@ function comment_build_content($comment, stdClass $node, $build_mode = 'full') {
* @return * @return
* A structured array of links. * A structured array of links.
*/ */
function comment_links($comment, stdClass $node) { function comment_links($comment, $node) {
$links = array(); $links = array();
if ($node->comment == COMMENT_NODE_OPEN) { if ($node->comment == COMMENT_NODE_OPEN) {
if (user_access('administer comments') && user_access('post comments')) { if (user_access('administer comments') && user_access('post comments')) {
...@@ -936,7 +936,7 @@ function comment_links($comment, stdClass $node) { ...@@ -936,7 +936,7 @@ function comment_links($comment, stdClass $node) {
* @return * @return
* An array in the format expected by drupal_render(). * An array in the format expected by drupal_render().
*/ */
function comment_build_multiple($comments, stdClass $node, $build_mode = 'full', $weight = 0) { function comment_build_multiple($comments, $node, $build_mode = 'full', $weight = 0) {
field_attach_prepare_view('comment', $comments, $build_mode); field_attach_prepare_view('comment', $comments, $build_mode);
$build = array( $build = array(
...@@ -1122,7 +1122,7 @@ function comment_node_load($nodes, $types) { ...@@ -1122,7 +1122,7 @@ function comment_node_load($nodes, $types) {
/** /**
* Implement hook_node_prepare(). * Implement hook_node_prepare().
*/ */
function comment_node_prepare(stdClass $node) { function comment_node_prepare($node) {
if (!isset($node->comment)) { if (!isset($node->comment)) {
$node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN); $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN);
} }
...@@ -1131,7 +1131,7 @@ function comment_node_prepare(stdClass $node) { ...@@ -1131,7 +1131,7 @@ function comment_node_prepare(stdClass $node) {
/** /**
* Implement hook_node_insert(). * Implement hook_node_insert().
*/ */
function comment_node_insert(stdClass $node) { function comment_node_insert($node) {
db_insert('node_comment_statistics') db_insert('node_comment_statistics')
->fields(array( ->fields(array(
'nid' => $node->nid, 'nid' => $node->nid,
...@@ -1146,7 +1146,7 @@ function comment_node_insert(stdClass $node) { ...@@ -1146,7 +1146,7 @@ function comment_node_insert(stdClass $node) {
/** /**
* Implement hook_node_delete(). * Implement hook_node_delete().
*/ */
function comment_node_delete(stdClass $node) { function comment_node_delete($node) {
$cids = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->nid))->fetchCol(); $cids = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->nid))->fetchCol();
comment_delete_multiple($cids); comment_delete_multiple($cids);
db_delete('node_comment_statistics') db_delete('node_comment_statistics')
...@@ -1157,7 +1157,7 @@ function comment_node_delete(stdClass $node) { ...@@ -1157,7 +1157,7 @@ function comment_node_delete(stdClass $node) {
/** /**
* Implement hook_node_update_index(). * Implement hook_node_update_index().
*/ */
function comment_node_update_index(stdClass $node) { function comment_node_update_index($node) {
$text = ''; $text = '';
if ($node->comment != COMMENT_NODE_HIDDEN) { if ($node->comment != COMMENT_NODE_HIDDEN) {
$comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array( $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(
...@@ -1182,7 +1182,7 @@ function comment_update_index() { ...@@ -1182,7 +1182,7 @@ function comment_update_index() {
/** /**
* Implement hook_node_search_result(). * Implement hook_node_search_result().
*/ */
function comment_node_search_result(stdClass $node) { function comment_node_search_result($node) {
if ($node->comment != COMMENT_NODE_HIDDEN) { if ($node->comment != COMMENT_NODE_HIDDEN) {
$comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField(); $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
return format_plural($comments, '1 comment', '@count comments'); return format_plural($comments, '1 comment', '@count comments');
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* @return * @return
* The rendered parent node or comment plus the new comment form. * The rendered parent node or comment plus the new comment form.
*/ */
function comment_reply(stdClass $node, $pid = NULL) { function comment_reply($node, $pid = NULL) {
// Set the breadcrumb trail. // Set the breadcrumb trail.
drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $node->nid))); drupal_set_breadcrumb(array(l(t('Home'), NULL), l($node->title[FIELD_LANGUAGE_NONE][0]['value'], 'node/' . $node->nid)));
$op = isset($_POST['op']) ? $_POST['op'] : ''; $op = isset($_POST['op']) ? $_POST['op'] : '';
......
...@@ -1271,7 +1271,7 @@ function field_attach_extra_weight($bundle, $pseudo_field) { ...@@ -1271,7 +1271,7 @@ function field_attach_extra_weight($bundle, $pseudo_field) {
* *
* TODO D7: We do not yet know if this really belongs in Field API. * TODO D7: We do not yet know if this really belongs in Field API.
*/ */
function field_attach_prepare_translation(stdClass $node) { function field_attach_prepare_translation($node) {
// Prevent against invalid 'nodes' built by broken 3rd party code. // Prevent against invalid 'nodes' built by broken 3rd party code.
if (isset($node->type)) { if (isset($node->type)) {
$type = content_types($node->type); $type = content_types($node->type);
......
...@@ -151,7 +151,7 @@ function forum_init() { ...@@ -151,7 +151,7 @@ function forum_init() {
* @return * @return
* Boolean indicating if the node can be assigned to a forum. * Boolean indicating if the node can be assigned to a forum.
*/ */
function _forum_node_check_node_type(stdClass $node) { function _forum_node_check_node_type($node) {
// Fetch information about the forum field. // Fetch information about the forum field.
$field = field_info_instance('node', 'taxonomy_forums', $node->type); $field = field_info_instance('node', 'taxonomy_forums', $node->type);
...@@ -161,7 +161,7 @@ function _forum_node_check_node_type(stdClass $node) { ...@@ -161,7 +161,7 @@ function _forum_node_check_node_type(stdClass $node) {
/** /**
* Implement hook_node_view(). * Implement hook_node_view().
*/ */
function forum_node_view(stdClass $node, $build_mode) { function forum_node_view($node, $build_mode) {
$vid = variable_get('forum_nav_vocabulary', 0); $vid = variable_get('forum_nav_vocabulary', 0);
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
...@@ -184,7 +184,7 @@ function forum_node_view(stdClass $node, $build_mode) { ...@@ -184,7 +184,7 @@ function forum_node_view(stdClass $node, $build_mode) {
/** /**
* Implement hook_node_prepare(). * Implement hook_node_prepare().
*/ */
function forum_node_prepare(stdClass $node) { function forum_node_prepare($node) {
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
if (empty($node->nid)) { if (empty($node->nid)) {
// New topic // New topic
...@@ -198,7 +198,7 @@ function forum_node_prepare(stdClass $node) { ...@@ -198,7 +198,7 @@ function forum_node_prepare(stdClass $node) {
* *
* Check in particular that only a "leaf" term in the associated taxonomy. * Check in particular that only a "leaf" term in the associated taxonomy.
*/ */
function forum_node_validate(stdClass $node, $form) { function forum_node_validate($node, $form) {
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
$langcode = $form['taxonomy_forums']['#language']; $langcode = $form['taxonomy_forums']['#language'];
// vocabulary is selected, not a "container" term. // vocabulary is selected, not a "container" term.
...@@ -224,7 +224,7 @@ function forum_node_validate(stdClass $node, $form) { ...@@ -224,7 +224,7 @@ function forum_node_validate(stdClass $node, $form) {
* *
* Assign forum taxonomy when adding a topic from within a forum. * Assign forum taxonomy when adding a topic from within a forum.
*/ */
function forum_node_presave(stdClass $node) { function forum_node_presave($node) {
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
// Make sure all fields are set properly: // Make sure all fields are set properly:
$node->icon = !empty($node->icon) ? $node->icon : ''; $node->icon = !empty($node->icon) ? $node->icon : '';
...@@ -243,7 +243,7 @@ function forum_node_presave(stdClass $node) { ...@@ -243,7 +243,7 @@ function forum_node_presave(stdClass $node) {
/** /**
* Implement hook_node_update(). * Implement hook_node_update().
*/ */
function forum_node_update(stdClass $node) { function forum_node_update($node) {
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
if (empty($node->revision) && db_query('SELECT tid FROM {forum} WHERE nid=:nid', array(':nid' => $node->nid))->fetchField()) { if (empty($node->revision) && db_query('SELECT tid FROM {forum} WHERE nid=:nid', array(':nid' => $node->nid))->fetchField()) {
if (!empty($node->forum_tid)) { if (!empty($node->forum_tid)) {
...@@ -291,7 +291,7 @@ function forum_node_update(stdClass $node) { ...@@ -291,7 +291,7 @@ function forum_node_update(stdClass $node) {
/** /**
* Implement hook_node_insert(). * Implement hook_node_insert().
*/ */
function forum_node_insert(stdClass $node) { function forum_node_insert($node) {
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
if (!empty($node->forum_tid)) { if (!empty($node->forum_tid)) {
$nid = db_insert('forum') $nid = db_insert('forum')
...@@ -308,7 +308,7 @@ function forum_node_insert(stdClass $node) { ...@@ -308,7 +308,7 @@ function forum_node_insert(stdClass $node) {
/** /**
* Implement hook_node_delete(). * Implement hook_node_delete().
*/ */
function forum_node_delete(stdClass $node) { function forum_node_delete($node) {
if (_forum_node_check_node_type($node)) { if (_forum_node_check_node_type($node)) {
db_delete('forum') db_delete('forum')
->condition('nid', $node->nid) ->condition('nid', $node->nid)
...@@ -602,7 +602,7 @@ function forum_block_view_pre_render($elements) { ...@@ -602,7 +602,7 @@ function forum_block_view_pre_render($elements) {
/** /**
* Implement hook_form(). * Implement hook_form().
*/ */
function forum_form(stdClass $node, $form_state) { function forum_form($node, $form_state) {
$type = node_type_get_type($node); $type = node_type_get_type($node);
if (!empty($node->nid)) { if (!empty($node->nid)) {
......
...@@ -301,7 +301,7 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -301,7 +301,7 @@ class ForumTestCase extends DrupalWebTestCase {
* @param $response * @param $response
* The exptected HTTP response code. * The exptected HTTP response code.
*/ */
private function verifyForums($node_user, stdClass $node, $admin, $response = 200) { private function verifyForums($node_user, $node, $admin, $response = 200) {
$crumb = '›'; $crumb = '›';
$quote = '''; $quote = ''';
......
...@@ -451,21 +451,21 @@ function menu_block_view_alter(&$data, $block) { ...@@ -451,21 +451,21 @@ function menu_block_view_alter(&$data, $block) {
/** /**
* Implement hook_node_insert(). * Implement hook_node_insert().
*/ */
function menu_node_insert(stdClass $node) { function menu_node_insert($node) {
menu_node_save($node); menu_node_save($node);
} }
/** /**
* Implement hook_node_update(). * Implement hook_node_update().
*/ */
function menu_node_update(stdClass $node) { function menu_node_update($node) {
menu_node_save($node); menu_node_save($node);
} }
/** /**
* Helper for hook_node_insert() and hook_node_update(). * Helper for hook_node_insert() and hook_node_update().
*/ */
function menu_node_save(stdClass $node) { function menu_node_save($node) {
if (isset($node->menu)) { if (isset($node->menu)) {
$link = &$node->menu; $link = &$node->menu;
if (empty($link['enabled'])) { if (empty($link['enabled'])) {
...@@ -490,7 +490,7 @@ function menu_node_save(stdClass $node) { ...@@ -490,7 +490,7 @@ function menu_node_save(stdClass $node) {
/** /**
* Implement hook_node_delete(). * Implement hook_node_delete().
*/ */
function menu_node_delete(stdClass $node) { function menu_node_delete($node) {
// Delete all menu module links that point to this node. // Delete all menu module links that point to this node.
$result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/' . $node->nid), array('fetch' => PDO::FETCH_ASSOC)); $result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/' . $node->nid), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $m) { foreach ($result as $m) {
...@@ -501,7 +501,7 @@ function menu_node_delete(stdClass $node) { ...@@ -501,7 +501,7 @@ function menu_node_delete(stdClass $node) {
/** /**
* Implement hook_node_prepare(). * Implement hook_node_prepare().
*/ */
function menu_node_prepare(stdClass $node) { function menu_node_prepare($node) {
if (empty($node->menu)) { if (empty($node->menu)) {
// Prepare the node for the edit form so that $node->menu always exists. // Prepare the node for the edit form so that $node->menu always exists.
$menu_name = variable_get('menu_default_node_menu', 'navigation'); $menu_name = variable_get('menu_default_node_menu', 'navigation');
......
...@@ -74,7 +74,7 @@ function hook_node_grants($account, $op) { ...@@ -74,7 +74,7 @@ function hook_node_grants($account, $op) {
* *
* @ingroup node_access * @ingroup node_access
*/ */
function hook_node_access_records(stdClass $node) { function hook_node_access_records($node) {
if (node_access_example_disabling()) { if (node_access_example_disabling()) {
return; return;
} }
...@@ -138,7 +138,7 @@ function hook_node_access_records(stdClass $node) { ...@@ -138,7 +138,7 @@ function hook_node_access_records(stdClass $node) {
* *
* @ingroup node_access * @ingroup node_access
*/ */
function hook_node_access_records_alter(&$grants, stdClass $node) { function hook_node_access_records_alter(&$grants, $node) {
// Our module allows editors to tag specific articles as 'preview' // Our module allows editors to tag specific articles as 'preview'
// content using the taxonomy system. If the node being saved // content using the taxonomy system. If the node being saved
// contains one of the preview terms defined in our variable // contains one of the preview terms defined in our variable
...@@ -265,7 +265,7 @@ function hook_node_operations() { ...@@ -265,7 +265,7 @@ function hook_node_operations() {
* @param $node * @param $node
* The node that is being deleted.