Skip to content

Commit 5dbfd14

Browse files
author
Tristan Darricau
committed
[ticket/13941] Workaround to fix the bug on php 5.5 with sqlite3
PHPBB3-13941
1 parent d8343f2 commit 5dbfd14

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

phpBB/phpbb/tree/nestedset.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,10 @@ public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids =
837837
' . $this->get_sql_where('AND') . '
838838
ORDER BY ' . $this->column_left_id . ', ' . $this->column_item_id . ' ASC';
839839
$result = $this->db->sql_query($sql);
840-
while ($row = $this->db->sql_fetchrow($result))
840+
$rows = $this->db->sql_fetchrowset($result);
841+
$this->db->sql_freeresult($result);
842+
843+
foreach ($rows as $row)
841844
{
842845
// First we update the left_id for this module
843846
if ($row[$this->column_left_id] != $new_id)
@@ -862,7 +865,6 @@ public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids =
862865
}
863866
$new_id++;
864867
}
865-
$this->db->sql_freeresult($result);
866868

867869
if ($acquired_new_lock)
868870
{

0 commit comments

Comments
 (0)