diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-25 13:40:25 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-25 13:40:25 +0200 |
commit | 4bff28a0eeaf44eae9e99725ead6ff2cf770b857 (patch) | |
tree | e85d6f46367bbe7111abc60579d8a6cad51b62d6 /phpBB/includes/nestedset/base.php | |
parent | 61e72d3a1000c48146466305c6693595324f5282 (diff) | |
download | forums-4bff28a0eeaf44eae9e99725ead6ff2cf770b857.tar forums-4bff28a0eeaf44eae9e99725ead6ff2cf770b857.tar.gz forums-4bff28a0eeaf44eae9e99725ead6ff2cf770b857.tar.bz2 forums-4bff28a0eeaf44eae9e99725ead6ff2cf770b857.tar.xz forums-4bff28a0eeaf44eae9e99725ead6ff2cf770b857.zip |
[ticket/11495] Rename fix function to regenerate_left_right_ids()
This method regenerates the left/right ids for the nested set based on the
parent/child relations. This function executes three queries per item, so
it should only be called, when the set has one of the following problems:
- The set has a duplicated value inside the left/right id chain
- The set has a missing value inside the left/right id chain
- The set has items that do not have a left/right is set
When regenerating the items, the items are sorted by parent id and their
current left id, so the current child/parent relationships are kept and
running the function on a working set will not change any orders.
PHPBB3-11495
Diffstat (limited to 'phpBB/includes/nestedset/base.php')
-rw-r--r-- | phpBB/includes/nestedset/base.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/nestedset/base.php b/phpBB/includes/nestedset/base.php index 9f83bd757c..1a6b578e79 100644 --- a/phpBB/includes/nestedset/base.php +++ b/phpBB/includes/nestedset/base.php @@ -674,7 +674,7 @@ abstract class phpbb_nestedset_base implements phpbb_nestedset_interface /** * @inheritdoc */ - public function recalculate_nested_set($new_id, $parent_id = 0, $reset_ids = false) + public function regenerate_left_right_ids($new_id, $parent_id = 0, $reset_ids = false) { if ($reset_ids) { @@ -716,7 +716,7 @@ abstract class phpbb_nestedset_base implements phpbb_nestedset_interface $new_id++; // Then we go through any children and update their left/right id's - $new_id = $this->recalculate_nested_set($new_id, $row[$this->column_item_id]); + $new_id = $this->regenerate_left_right_ids($new_id, $row[$this->column_item_id]); // Then we come back and update the right_id for this module if ($row[$this->column_right_id] != $new_id) |