From d0823f1b5017689b9766baa406a8f2cb5d5eecf1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 12 Aug 2020 13:24:50 -0700 Subject: [PATCH] Schedule task was failing when multiple tab items were selected/saved. --- e107_admin/cron.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/e107_admin/cron.php b/e107_admin/cron.php index 1202af244..e0e51a5dc 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -325,7 +325,16 @@ class cron_admin_ui extends e_admin_ui // Process _POST before saving. public function beforeUpdate($new_data, $old_data, $id) { - $new_data['cron_tab'] = implode(" ", $new_data['tab']); + + $tab = []; + foreach($new_data['tab'] as $t) + { + $tab[] = implode(",", $t); + } + + $new_data['cron_tab'] = implode(" ", $tab); + + e107::getMessage()->addDebug("Cron Tab: ".$new_data['cron_tab']); return $new_data; } @@ -627,7 +636,7 @@ class cron_admin_form_ui extends e_admin_form_ui $text = " - \n"; foreach ($this->min_options as $key => $val) @@ -655,7 +664,7 @@ class cron_admin_form_ui extends e_admin_form_ui $text .= " - \n"; foreach ($this->hour_options as $key => $val) @@ -680,7 +689,7 @@ class cron_admin_form_ui extends e_admin_form_ui } $text .= " - \n"; $sel_day = ($day[0] == "*") ? "selected='selected'" : ""; @@ -692,7 +701,7 @@ class cron_admin_form_ui extends e_admin_form_ui } $text .= " - \n"; $sel_month = ($month[0] == "*") ? "selected='selected'" : ""; $text .= "\n"; // Every Month @@ -705,7 +714,7 @@ class cron_admin_form_ui extends e_admin_form_ui } $text .= " - \n"; $sel_weekday = ($weekday[0] == "*") ? "selected='selected'" : ""; $text .= "\n"; // Every Week Day.