From b31a871ca7f61eb235f0e8915e70c26dcda0b0f6 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 1 Oct 2006 18:26:53 +0000 Subject: [PATCH] r1225: We can now add an automation if there are no custom fields present --- admin/automation.php | 20 ++++++++++++++------ docs/changes.txt | 3 ++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/admin/automation.php b/admin/automation.php index a28899b..ec294a8 100644 --- a/admin/automation.php +++ b/admin/automation.php @@ -63,19 +63,27 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'insert' OR $_POST['do'] == 'update') { - foreach ($bugsys->in['fields'] AS $key => $value) + $deltas = array('builtin' => array(), 'custom' => array()); + + if (is_array($bugsys->in['fields'])) { - if (!empty($value) AND $value != -1 AND !is_array($value)) + foreach ($bugsys->in['fields'] AS $key => $value) { - $deltas['builtin']["$key"] = $value; + if (!empty($value) AND $value != -1 AND !is_array($value)) + { + $deltas['builtin']["$key"] = $value; + } } } - foreach ($bugsys->in['fields']['custom'] AS $key => $value) + if (is_array($bugsys->in['fields']['custom'])) { - if (!empty($value) AND $value != -1) + foreach ($bugsys->in['fields']['custom'] AS $key => $value) { - $deltas['custom']["$key"] = $value; + if (!empty($value) AND $value != -1) + { + $deltas['custom']["$key"] = $value; + } } } diff --git a/docs/changes.txt b/docs/changes.txt index 3280179..b3b0b60 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -4,7 +4,8 @@ - Renamed "automatic action" to "automation" - If no user comment is entered but there's an automation comment, then the automation comment is no longer disregarded - Get rid of a foreach() warning if there are no products [admin/product.php#317] -- If no custom fields were setup, an empty query error would be thrown [newreport.php:130] +- If no custom fields were setup, an empty query error would be thrown [newreport.php#130] +- If no custom fields were present, adding an automation would fail [admin/automation.php#74] 1.1.0 Release Candidate 1 =============================== -- 2.43.5