diff --git a/includes/form.inc b/includes/form.inc index 5d838002f861d1df928a95d97ccbf2fa35feb8fc..45df7f9fa1b7cb0466b9bc844879eef88ad5aa71 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -333,7 +333,7 @@ function _form_validate($elements, $form_id = NULL) { } elseif (!isset($options[$elements['#value']])) { form_error($elements, t('An illegal choice has been detected. Please contact the site administrator.')); - watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme_placeholder(check_plain($v)), '%name' => theme('placeholder', empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']))), WATCHDOG_ERROR); + watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme_placeholder(check_plain($elements['#value'])), '%name' => theme('placeholder', empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']))), WATCHDOG_ERROR); } } } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 4551e04160d9e367a462dc56f6b0a4f66851318c..4a7d42152ef69e7295eb4181d0c7116701f9bf9f 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -833,6 +833,8 @@ function aggregator_parse_feed(&$data, $feed) { $items = array_reverse($items); + // Initialize variables + $title = $link = $author = $description = $guid = NULL; foreach ($items as $item) { unset($title, $link, $author, $description, $guid); @@ -1057,6 +1059,7 @@ function _aggregator_page_list($sql, $op, $header = '') { $result = pager_query($sql, 20); $categories = array(); + $done = FALSE; while ($item = db_fetch_object($result)) { $form['items'][$item->iid] = array('#value' => theme('aggregator_page_item', $item)); $output .= $form['items'][$item->iid]['#value']; diff --git a/modules/book/book.module b/modules/book/book.module index 584c78b5b7dcbf6fcd5676f2b5531a14883711ba..979dbf6137d30734c2448564b98f035b02765e19 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -553,6 +553,7 @@ function book_toc_recurse($nid, $indent, $toc, $children, $exclude) { function book_toc($exclude = 0) { $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.status = 1 ORDER BY b.weight, n.title')); + $children = array(); while ($node = db_fetch_object($result)) { if (!$children[$node->parent]) { $children[$node->parent] = array(); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d8382770b853e6ac39bf5d60702a0f966c4edcbf..fed6e19d31d429f3a829ab910b6fd46ab397e1b8 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1617,7 +1617,6 @@ function theme_comment_folded($comment) { function theme_comment_flat_collapsed($comment) { return theme('comment_view', $comment, '', 0); - return ''; } function theme_comment_flat_expanded($comment) { diff --git a/modules/filter/filter.module b/modules/filter/filter.module index e6676bc1525ba062a6e3cfc4fb7adb4550893d02..bdf2185709ca932c1dc906a7624529f8b934c524 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -846,7 +846,7 @@ function filter_form_validate($form) { } } form_error($form, t('An illegal choice has been detected. Please contact the site administrator.')); - watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme('placeholder', check_plain($v)), '%name' => theme('placeholder', empty($form['#title']) ? $form['#parents'][0] : $form['#title']))), WATCHDOG_ERROR); + watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme('placeholder', check_plain($form[$key]['#value'])), '%name' => theme('placeholder', empty($form['#title']) ? $form['#parents'][0] : $form['#title']))), WATCHDOG_ERROR); } /** diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 46f34d02441248a204f8020dedebd6435b06aa3f..376c31512a442e4d68878eab38ba29cd417fb30d 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -1060,6 +1060,7 @@ function theme_forum_topic_navigation($node) { $sql = "SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid AND r.tid = %d WHERE n.status = 1 AND n.type = 'forum' ORDER BY n.sticky DESC, ". _forum_get_topic_order_sql(variable_get('forum_order', 1)); $result = db_query(db_rewrite_sql($sql), $node->tid); + $stop = 0; while ($topic = db_fetch_object($result)) { if ($stop == 1) { $next = new StdClass(); diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 0226f083fe101dfaeab1a6b3e9c0ed91dbca22fd..8f36b87e1e5807467c242aa637065c47e4b07ba0 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -54,10 +54,9 @@ function locale_help($section) { */ function locale_menu($may_cache) { $items = array(); + $access = user_access('administer locales'); if ($may_cache) { - $access = user_access('administer locales'); - // Main admin menu item $items[] = array('path' => 'admin/settings/locale', 'title' => t('localization'), diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 5d70681094eac944c7c1589cffb1f35ce5dcbe19..6ee82c4576820cd72a588812a2b4c60116183629 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -570,6 +570,8 @@ function poll_update($node) { db_query('DELETE FROM {poll_choices} WHERE nid = %d', $node->nid); db_query('DELETE FROM {poll_votes} WHERE nid = %d', $node->nid); + + $i = 0; foreach ($node->choice as $choice) { $chvotes = (int)$choice['chvotes']; $chtext = $choice['chtext']; diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 9e7dbf285b5c2536900daa2acbc21f68e70ca474..db86fc314a8d661775e875f85e8dc5dbe2be0648 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -634,6 +634,7 @@ function profile_form_profile($edit, $user, $category) { // Use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues. } + $w = 0; while ($field = db_fetch_object($result)) { $category = $field->category; if (!isset($fields[$category])) { diff --git a/modules/search/search.module b/modules/search/search.module index 66454797c3a604b9bfb033638cf5cd7ba5683d19..566c2c4db34f7cfa6314a9437a72af3b0f78a053 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -243,7 +243,7 @@ function search_admin_settings() { * Menu callback: confirm wiping of the index. */ function search_wipe_confirm() { - return confirm_form('search_wipe_confirm', $form, t('Are you sure you want to re-index the site?'), + return confirm_form('search_wipe_confirm', array(), t('Are you sure you want to re-index the site?'), 'admin/settings/search', t(' The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed. This action cannot be undone.'), t('Re-index site'), t('Cancel')); } diff --git a/modules/user/user.module b/modules/user/user.module index 740e14431687f3326f645ba7707b9d59c1ec6d93..acd22b470f802216d765ca5abcbd38dfcca489f8 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1088,6 +1088,7 @@ function user_pass_reset($uid, $timestamp, $hashed_pass, $action = NULL) { // Now we can set the new user. $user = $account; // And proceed with normal login, going to user page. + $edit = array(); user_module_invoke('login', $edit, $user); drupal_set_message(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.')); drupal_goto('user/'. $user->uid .'/edit'); @@ -1153,7 +1154,10 @@ function user_register() { // Redirect back to page which initiated the create request; usually admin/user/user/create $form['destination'] = array('#type' => 'hidden', '#value' => $_GET['q']); } - $extra = _user_forms($null, $null, $null, 'register'); + + // Create a dummy variable for pass-by-reference parameters. + $null = NULL; + $extra = _user_forms($null, NULL, NULL, 'register'); // Remove form_group around default fields if there are no other groups. if (!$extra) {