From cb710243d877ce7fc1f87615027d4efa4fd9ef96 Mon Sep 17 00:00:00 2001 From: JediKev <kevin@enhancesoft.com> Date: Tue, 26 Feb 2019 12:11:22 -0600 Subject: [PATCH] issue: PHP 7.2 Ticket Status This addresses issue 4716 where updating a Ticket Status throws a fatal error of "Too few arguments" when using PHP 7.2. This is due to `$errors` not being passed to the `update()` function causing PHP 7.2 to freak out. This creates an `$errors` array and passes it to `update()` so PHP 7.2 is happy and we are all happy. :) --- include/ajax.forms.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ajax.forms.php b/include/ajax.forms.php index 9ca601e33..def1436d3 100644 --- a/include/ajax.forms.php +++ b/include/ajax.forms.php @@ -149,6 +149,8 @@ class DynamicFormsAjaxAPI extends AjaxController { function saveListItem($list_id, $item_id) { global $thisstaff; + $errors = array(); + if (!$thisstaff) Http::response(403, 'Login required'); @@ -177,7 +179,7 @@ class DynamicFormsAjaxAPI extends AjaxController { 'name' => $basic['name'], 'value' => $basic['value'], 'abbrev' => $basic['extra'], - ]); + ], $errors); } } -- GitLab