diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-01-23 21:33:19 -0500 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-01-23 21:33:19 -0500 |
commit | aa8fffcd8fc7d16f4bd84a9f8f7ead206d9ce45a (patch) | |
tree | 484ad936b32d0683c0ad45c898fa900ca5857546 /modules/organize/controllers/organize.php | |
parent | de78d3bfca20fec80fc87a7c5e2d18f3fdd791f1 (diff) |
Extract reweighting logic out of Organize_Controller into
item::reweight_all_children as an API and write a test for it. Work
in progress on #1914.
Diffstat (limited to 'modules/organize/controllers/organize.php')
-rw-r--r-- | modules/organize/controllers/organize.php | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 97280489..37920020 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -128,13 +128,7 @@ class Organize_Controller extends Controller { access::required("edit", $album); if ($album->sort_column != "weight") { - // Force all the weights into the current order before changing the order to manual - $weight = 0; - foreach ($album->children() as $child) { - $child->weight = ++$weight; - $child->save(); - } - + item::resequence_child_weights($album); $album->sort_column = "weight"; $album->sort_order = "ASC"; $album->save(); |