diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 708b3a5..978276d 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -462,8 +462,12 @@ class ActivityController extends Controller do { array_pop($activityStack); $lastStack = end($activityStack); - if ($activity->level > $lastStack->level) + if ($lastStack) { + if ($activity->level > $lastStack->level) + $lastStackIsNotRight = false; + } else { $lastStackIsNotRight = false; + } } while ($lastStackIsNotRight); } diff --git a/app/Http/Controllers/ShowHideColumnController.php b/app/Http/Controllers/ShowHideColumnController.php index a2db693..be5292f 100644 --- a/app/Http/Controllers/ShowHideColumnController.php +++ b/app/Http/Controllers/ShowHideColumnController.php @@ -45,12 +45,12 @@ class ShowHideColumnController extends Controller $success = 0; - foreach ($columns as $column) { + foreach ($columns as $key => $column) { $dataAdd = array( 'version_gantt_id'=>$request->version_gantt_id, 'user_id'=>$this->currentId, - 'column_name'=>$column, - 'show'=>true, + 'column_name'=>$key, + 'show'=>$column, 'created_by'=>$this->currentName );