Fixes search token database reconstruction.
authorStéphane Jacob <sj@m4x.org>
Tue, 25 May 2010 13:19:55 +0000 (15:19 +0200)
committerStéphane Jacob <sj@m4x.org>
Wed, 26 May 2010 07:42:20 +0000 (09:42 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
bin/search.rebuild_db.php
classes/profile.php

index cd7e56c..5e43d31 100755 (executable)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require('./connect.db.inc.php');
+require './connect.db.inc.php';
 
-ini_set('memory_limit', "16M");
+ini_set('memory_limit', '16M');
 $globals->debug = 0; // Do not store backtraces
 
 $res = XDB::iterRow('SELECT  pid
                        FROM  profiles');
 $i = 0;
 $n = $res->total();
-while ($pid = $res->next()->fetchOneCell()) {
-    Profile::rebuildSearchTokens($pid);
+while ($pid = $res->next()) {
+    Profile::rebuildSearchTokens(intval($pid[0]));
     printf("\r%u / %u",  ++$i, $n);
 }
 
index 53d9100..de46ff5 100644 (file)
@@ -897,7 +897,7 @@ class Profile
                                 WHERE  n.pid = {?}",
                               $pid);
 
-        foreach ($keys as $i => $key) {
+        while ($key = $keys->next()) {
             if ($key['name'] == '') {
                 continue;
             }