? example.patch
? get_patch.sh
Index: modules/blog/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v
retrieving revision 1.297.2.4
diff -u -p -r1.297.2.4 blog.module
--- modules/blog/blog.module	25 Feb 2009 12:21:53 -0000	1.297.2.4
+++ modules/blog/blog.module	29 Nov 2010 13:05:56 -0000
@@ -193,14 +193,14 @@ function _blog_post_exists($account) {
  * Displays the most recent 10 blog titles.
  */
 function blog_block($op = 'list', $delta = 0) {
-  global $user;
+  global $user, $language;
   if ($op == 'list') {
     $block[0]['info'] = t('Recent blog posts');
     return $block;
   }
   else if ($op == 'view') {
     if (user_access('access content')) {
-      $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10);
+      $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.language = '$language->language' ORDER BY n.created DESC"), 0, 10);
       if ($node_title_list = node_title_list($result)) {
         $block['content'] = $node_title_list;
         $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.'));
Index: modules/blog/blog.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.pages.inc,v
retrieving revision 1.6.2.3
diff -u -p -r1.6.2.3 blog.pages.inc
--- modules/blog/blog.pages.inc	14 Sep 2009 15:08:00 -0000	1.6.2.3
+++ modules/blog/blog.pages.inc	29 Nov 2010 13:05:57 -0000
@@ -10,7 +10,7 @@
  * Menu callback; displays a Drupal page containing recent blog entries of a given user.
  */
 function blog_page_user($account) {
-  global $user;
+  global $user, $language;
 
   drupal_set_title($title = t("@name's blog", array('@name' => $account->name)));
 
@@ -25,7 +25,7 @@ function blog_page_user($account) {
 
   $output = theme('item_list', $items);
 
-  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
+  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 AND n.language = '$language->language' ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
   $has_posts = FALSE;
   
   while ($node = db_fetch_object($result)) {
@@ -53,7 +53,7 @@ function blog_page_user($account) {
  * Menu callback; displays a Drupal page containing recent blog entries of all users.
  */
 function blog_page_last() {
-  global $user;
+  global $user, $language;
 
   $output = '';
   $items = array();
@@ -64,7 +64,7 @@ function blog_page_last() {
 
   $output = theme('item_list', $items);
 
-  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
+  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.language = '$language->language' ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
   $has_posts = FALSE;
 
   while ($node = db_fetch_object($result)) {
@@ -87,7 +87,8 @@ function blog_page_last() {
  * Menu callback; displays an RSS feed containing recent blog entries of a given user.
  */
 function blog_feed_user($account) {
-  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n  WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
+  global $language;
+  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n  WHERE n.type = 'blog' AND n.uid = %d AND n.status = 1 AND n.language = '$language->language' ORDER BY n.created DESC"), $account->uid, 0, variable_get('feed_default_items', 10));
   $channel['title'] = t("!name's blog", array('!name' => $account->name));
   $channel['link'] = url('blog/'. $account->uid, array('absolute' => TRUE));
 
@@ -102,7 +103,8 @@ function blog_feed_user($account) {
  * Menu callback; displays an RSS feed containing recent blog entries of all users.
  */
 function blog_feed_last() {
-  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
+  global $language;
+  $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.language = '$language->language' ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
   $channel['title'] = t('!site_name blogs', array('!site_name' => variable_get('site_name', 'Drupal')));
   $channel['link'] = url('blog', array('absolute' => TRUE));
 
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.947.2.28
diff -u -p -r1.947.2.28 node.module
--- modules/node/node.module	4 Nov 2010 10:09:20 -0000	1.947.2.28
+++ modules/node/node.module	29 Nov 2010 13:05:57 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: node.module,v 1.947.2.28 2010/11/04 10:09:20 goba Exp $
+// $Id: node.module,v 1.947.2.26 2010/08/06 11:41:13 goba Exp $
 
 /**
  * @file
@@ -816,13 +816,7 @@ function node_validate($node, $form = ar
 }
 
 /**
- * Prepares a node for saving by populating teaser, author, and creation date.
- *
- * @param object|array $node
- *   A node object or array.
- *
- * @return
- *   A validated node object with a populated teaser, author, and creation date.
+ * Prepare node for save and allow modules to make changes.
  */
 function node_submit($node) {
   global $user;
@@ -1667,7 +1661,7 @@ function node_feed($nids = FALSE, $chann
 
   if ($nids === FALSE) {
     $nids = array();
-    $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.created DESC'), 0, variable_get('feed_default_items', 10));
+    $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 AND n.language = '$language->language' ORDER BY n.created DESC"), 0, variable_get('feed_default_items', 10));
     while ($row = db_fetch_object($result)) {
       $nids[] = $row->nid;
     }
@@ -1763,7 +1757,8 @@ function node_feed($nids = FALSE, $chann
  * Menu callback; Generate a listing of promoted nodes.
  */
 function node_page_default() {
-  $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));
+  global $language;
+  $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 AND n.language = '$language->language' ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10));
 
   $output = '';
   $num_rows = FALSE;
@@ -2694,7 +2689,7 @@ function node_save_action($node) {
 function node_assign_owner_action(&$node, $context) {
   $node->uid = $context['owner_uid'];
   $owner_name = db_result(db_query("SELECT name FROM {users} WHERE uid = %d", $context['owner_uid']));
-  watchdog('action', 'Changed owner of @type %title to uid %name.', array('@type' => node_get_types('name', $node), '%title' => $node->title, '%name' => $owner_name));
+  watchdog('action', 'Changed owner of @type %title to uid %name.', array('@type' => node_get_types('type', $node), '%title' => $node->title, '%name' => $owner_name));
 }
 
 function node_assign_owner_action_form($context) {
Index: modules/search/search-results.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search-results.tpl.php,v
retrieving revision 1.1
diff -u -p -r1.1 search-results.tpl.php
--- modules/search/search-results.tpl.php	31 Oct 2007 18:06:38 -0000	1.1
+++ modules/search/search-results.tpl.php	29 Nov 2010 13:05:57 -0000
@@ -21,7 +21,9 @@
  * @see template_preprocess_search_results()
  */
 ?>
+<?php if ($search_results) {?>
 <dl class="search-results <?php print $type; ?>-results">
   <?php print $search_results; ?>
 </dl>
+<?php }?>
 <?php print $pager; ?>
Index: modules/search/search.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v
retrieving revision 1.4
diff -u -p -r1.4 search.pages.inc
--- modules/search/search.pages.inc	6 Dec 2007 09:51:01 -0000	1.4
+++ modules/search/search.pages.inc	29 Nov 2010 13:05:57 -0000
@@ -61,6 +61,8 @@ function search_view($type = 'node') {
 function template_preprocess_search_results(&$variables) {
   $variables['search_results'] = '';
   foreach ($variables['results'] as $result) {
+    $url = check_url($result['link']);
+    if (!strstr($url,'node/'))
     $variables['search_results'] .= theme('search_result', $result, $variables['type']);
   }
   $variables['pager'] = theme('pager', NULL, 10, 0);
Index: modules/tracker/tracker.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v
retrieving revision 1.5
diff -u -p -r1.5 tracker.pages.inc
--- modules/tracker/tracker.pages.inc	28 Nov 2007 10:29:20 -0000	1.5
+++ modules/tracker/tracker.pages.inc	29 Nov 2010 13:05:57 -0000
@@ -11,6 +11,7 @@
  * Menu callback. Prints a listing of active nodes on the site.
  */
 function tracker_page($account = NULL, $set_title = FALSE) {
+  global $language;
   // Add CSS
   drupal_add_css(drupal_get_path('module', 'tracker') .'/tracker.css', 'module', 'all', FALSE);
 
@@ -22,14 +23,14 @@ function tracker_page($account = NULL, $
       drupal_set_title(check_plain($account->name));
     }
   // TODO: These queries are very expensive, see http://drupal.org/node/105639
-    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d) ORDER BY last_updated DESC';
+    $sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {users} u ON n.uid = u.uid LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d) AND n.language = '$language->language' ORDER BY last_updated DESC";
     $sql = db_rewrite_sql($sql);
     $sql_count = 'SELECT COUNT(DISTINCT(n.nid)) FROM {node} n LEFT JOIN {comments} c ON n.nid = c.nid AND (c.status = %d OR c.status IS NULL) WHERE n.status = 1 AND (n.uid = %d OR c.uid = %d)';
     $sql_count = db_rewrite_sql($sql_count);
     $result = pager_query($sql, 25, 0, $sql_count, COMMENT_PUBLISHED, $account->uid, $account->uid);
   }
   else {
-    $sql = 'SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 ORDER BY last_updated DESC';
+    $sql = "SELECT DISTINCT(n.nid), n.title, n.type, n.changed, n.uid, u.name, GREATEST(n.changed, l.last_comment_timestamp) AS last_updated, l.comment_count FROM {node} n INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {node_comment_statistics} l ON n.nid = l.nid WHERE n.status = 1 AND n.language = '$language->language' ORDER BY last_updated DESC";
     $sql = db_rewrite_sql($sql);
     $sql_count = 'SELECT COUNT(n.nid) FROM {node} n WHERE n.status = 1';
     $sql_count = db_rewrite_sql($sql_count);
