From aa5bd5d83836fe990300dfe4e578436f1cbfcb11 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 18 Aug 2006 22:44:03 +0000 Subject: [PATCH] r1085: If you delete a resolution, severity, priority, or status, make sure that we set any bugs with that value back to the default values in $bugsys->options[] --- docs/changes.txt | 1 + includes/api_priority.php | 1 + includes/api_resolution.php | 1 + includes/api_severity.php | 1 + includes/api_status.php | 1 + 5 files changed, 5 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 6f475db..81408de 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -10,6 +10,7 @@ - Fix a call to a non-object error [editcomment.php#116] - Switch to gettext language system instead of the XML-strings format - Fixing warnings related to Printer->page_confirm() throughout the entire admin section +- After you delete a resolution, severity, priority, or status, set all bugs with the deleted field item back to the value set as default 1.1.0 Beta 1 ================== diff --git a/includes/api_priority.php b/includes/api_priority.php index 8a48dba..a37406a 100644 --- a/includes/api_priority.php +++ b/includes/api_priority.php @@ -90,6 +90,7 @@ class PriorityAPI extends API function post_delete() { build_priorities(); + $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . $this->registry->options['defaultpriority'] . " WHERE priority = " . $this->values['priorityid']); } } diff --git a/includes/api_resolution.php b/includes/api_resolution.php index 46af56c..aaae47f 100644 --- a/includes/api_resolution.php +++ b/includes/api_resolution.php @@ -90,6 +90,7 @@ class ResolutionAPI extends API function post_delete() { build_resolutions(); + $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET resolution = " . $this->registry->options['defaultresolution'] . " WHERE resolution = " . $this->values['resolutionid']); } } diff --git a/includes/api_severity.php b/includes/api_severity.php index 678ca19..b35b967 100644 --- a/includes/api_severity.php +++ b/includes/api_severity.php @@ -90,6 +90,7 @@ class SeverityAPI extends API function post_delete() { build_severities(); + $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET severity = " . $this->registry->options['defaultseverity'] . " WHERE severity = " . $this->values['severityid']); } } diff --git a/includes/api_status.php b/includes/api_status.php index 900381c..1b44f63 100644 --- a/includes/api_status.php +++ b/includes/api_status.php @@ -91,6 +91,7 @@ class StatusAPI extends API function post_delete() { build_statuses(); + $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET status = " . $this->registry->options['defaultstatus'] . " WHERE status = " . $this->values['statusid']); } } -- 2.22.5