summaryrefslogtreecommitdiff
path: root/modules/organize/helpers/organize_task.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/organize/helpers/organize_task.php')
-rw-r--r--modules/organize/helpers/organize_task.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/organize/helpers/organize_task.php b/modules/organize/helpers/organize_task.php
index 735a0831..f923fdc7 100644
--- a/modules/organize/helpers/organize_task.php
+++ b/modules/organize/helpers/organize_task.php
@@ -28,13 +28,10 @@ class organize_task_Core {
try {
$stop = $context["position"] + $context["batch"];
- $sql = "";
for (; $context["position"] < $stop; $context["position"]++ ) {
$id = $context["items"][$context["position"]];
- $sql .= "Update {items} set weight = {$context["position"]} where id=$id;";
- }
- if (!empty($sql)) {
- $db = Database::instance()->query($sql);
+ Database::instance()
+ ->query("Update {items} set weight = {$context["position"]} where id=$id;");
}
$task->state = "success";
} catch(Exception $e) {