From e6f2eeb9ba66ea480b799aba8ba0a1336c85c33b Mon Sep 17 00:00:00 2001 From: Maxim Spokoiny Date: Thu, 21 Apr 2016 09:53:28 +0300 Subject: [PATCH] fixed situation then rank of source and target entities is the same --- core/components/gallery/processors/mgr/item/sort.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/components/gallery/processors/mgr/item/sort.php b/core/components/gallery/processors/mgr/item/sort.php index 6f13021..0833eea 100644 --- a/core/components/gallery/processors/mgr/item/sort.php +++ b/core/components/gallery/processors/mgr/item/sort.php @@ -48,7 +48,7 @@ AND rank > 0 "); $newRank = $target->get('rank'); -} else { +} elseif($source->get('rank') > $target->get('rank')) { $modx->exec(" UPDATE {$modx->getTableName('galAlbumItem')} SET rank = rank + 1 @@ -62,4 +62,4 @@ $source->set('rank',$newRank); $source->save(); -return $modx->error->success(); \ No newline at end of file +return $modx->error->success();