From 5d56faebeecc3ef821865b0a850fea140acd82d5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 7 Jul 2024 08:36:11 +1000 Subject: [PATCH] Fixes for task imports --- app/Repositories/TaskRepository.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index 5269ca541e69..0c1e3aeaae9e 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -117,10 +117,15 @@ class TaskRepository extends BaseRepository } $key_values = array_column($time_log, 0); - array_multisort($key_values, SORT_ASC, $time_log); + + if(count($key_values) > 0) + array_multisort($key_values, SORT_ASC, $time_log); foreach($time_log as $key => $value) { - $time_log[$key][1] = $this->roundTimeLog($time_log[$key][0], $time_log[$key][1]); + + if(is_array($time_log[$key]) && count($time_log[$key]) >=2) + $time_log[$key][1] = $this->roundTimeLog($time_log[$key][0], $time_log[$key][1]); + } if (isset($data['action'])) {