summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-05-18 06:17:05 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-05-18 06:17:05 -0700
commite0b74314dcdc36fa4d189589d1b6099ecd24cd8c (patch)
treee663d19c78dfaf77c30545f1117d19830334f8a5
parentb5b9aeb22cd8af74ce9c396de43ca3db500447e2 (diff)
parent73c7ec53102c24de248d1424fdf8d5ba347c2200 (diff)
Merge branch 'master' into talmdal_dev
-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) {