From bdfcf07fe1e6ea09f2982f31d65c12536c593eaf Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Wed, 19 Aug 2026 15:46:55 +0400 Subject: [PATCH] fix(models): handle empty location IDs in saveSortOrder method Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> --- app/Models/Stock_location.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/Stock_location.php b/app/Models/Stock_location.php index de01fcd14..348384f7b 100644 --- a/app/Models/Stock_location.php +++ b/app/Models/Stock_location.php @@ -182,6 +182,10 @@ class Stock_location extends Model */ public function saveSortOrder(array $orderedLocationIds): bool { + if (empty($orderedLocationIds)) { + return true; + } + $table = $this->db->prefixTable('stock_locations'); $builder = $this->db->table('stock_locations');