Ver código fonte

Fix modules as Drupal 6.2 does not provide db_num_rows() anymore.

Ralf S. Engelschall 17 anos atrás
pai
commit
3f0af46944
1 arquivos alterados com 40 adições e 1 exclusões
  1. 40 1
      drupal/drupal.patch

+ 40 - 1
drupal/drupal.patch

@@ -330,7 +330,7 @@ Index: sites/all/modules/img_assist/img_assist_popup.js
 --- /dev/null	2008-05-02 21:08:21 +0200
 +++ sites/all/modules/img_assist/img_assist_popup.js	2008-05-02 21:05:56 +0200
 @@ -0,0 +1,20 @@
-+/* $Id: drupal.patch,v 1.21 2008/06/14 13:14:46 rse Exp $ */
++/* $Id: drupal.patch,v 1.22 2008/06/14 14:01:05 rse Exp $ */
 +
 +function launch_popup(nid, mw, mh) {
 +	var ox = mw;
@@ -727,3 +727,42 @@ Index: sites/all/modules/simplefeed/simplefeed.install
    return $ret;
  }
  
+-----------------------------------------------------------------------------
+
+Fix modules as Drupal 6.2 does not provide db_num_rows() anymore.
+
+Index: sites/all/modules/simplefeed/simplefeed_item.install
+--- sites/all/modules/simplefeed/simplefeed_item.install.orig	2008-06-11 07:22:28 +0200
++++ sites/all/modules/simplefeed/simplefeed_item.install	2008-06-14 15:49:19 +0200
+@@ -40,13 +40,15 @@
+   // Fetch up to N feed items and update their iids to new schema
+   $count = $_SESSION['simplefeed_item_update_2']['count'];
+   $feed_items = db_query_range('SELECT r.vid, r.title, s.url FROM {node_revisions} r JOIN {simplefeed_feed_item} s ON r.vid = s.vid ORDER BY r.vid ASC', $count, $limit);
++  $n = 0;
+   while ($feed_item = db_fetch_object($feed_items)) {
+     $iid = md5($feed_item->title . $feed_item->url);
+     db_query("UPDATE {simplefeed_feed_item} SET iid = '%s' WHERE vid = %d", $iid, $feed_item->vid);
+     $_SESSION['simplefeed_item_update_2']['vid'] = $feed_item->vid;    
++    $n++;
+   }
+ 
+-  if (db_num_rows($feed_items) == $limit) {
++  if ($n == $limit) {
+     $_SESSION['simplefeed_item_update_2']['count'] += $limit;
+     // Return progress (never return 100% here to ensure clean-up is still run last).
+     return array('#finished' => $_SESSION['simplefeed_item_update_2']['vid'] / ($_SESSION['simplefeed_item_update_2']['max'] + 1));
+Index: sites/all/modules/autologout/autologout.module
+--- sites/all/modules/autologout/autologout.module.orig	2008-03-14 21:05:41 +0100
++++ sites/all/modules/autologout/autologout.module	2008-06-14 15:57:27 +0200
+@@ -257,8 +257,8 @@
+       if (_autologout_user_in_by_user_role($account)) {
+         $account->autologout = 0;
+         $r = db_query("SELECT setting FROM {autologout} WHERE uid = %d", $account->uid);
+-        if (db_num_rows($r) > 0) {
+-          $row = db_fetch_object($r);
++        $row = db_fetch_object($r);
++        if ($row) {
+           $account->autologout = (int)$row->setting;
+         }
+       }
+