summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/item_rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-05-18 09:11:23 -0700
committerBharat Mediratta <bharat@menalto.com>2010-05-18 09:11:23 -0700
commit110350776d5bda3b8535f0329ea69b914daa8019 (patch)
tree23dc6ea1be05d809e4dd01f1e161728f2db132e8 /modules/gallery/helpers/item_rest.php
parentab204d27201951c7915cf0eb871751b145e398aa (diff)
parent73c7ec53102c24de248d1424fdf8d5ba347c2200 (diff)
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/item_rest.php')
-rw-r--r--modules/gallery/helpers/item_rest.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php
index 36d2ca62..298c2f4a 100644
--- a/modules/gallery/helpers/item_rest.php
+++ b/modules/gallery/helpers/item_rest.php
@@ -126,18 +126,19 @@ class item_rest_Core {
}
}
}
+ $item->save();
- $weight = 0;
if (isset($request->params->members)) {
+ $weight = 0;
foreach ($request->params->members as $url) {
$child = rest::resolve($url);
if ($child->parent_id == $item->id && $child->weight != $weight) {
- $child->weight = $weight++;
+ $child->weight = $weight;
$child->save();
}
+ $weight++;
}
}
- $item->save();
}
static function post($request) {