From c86bbe2d4d37e21c17c84ec151a48fb3145bae84 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 13 Feb 2007 06:45:26 +0000 Subject: [PATCH] r1400: Fixed the issue with logging in mass updates --- editreport.php | 14 ++------------ includes/class_logging.php | 23 +++++++++-------------- search.php | 7 ++++--- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/editreport.php b/editreport.php index 170ac04..992a170 100644 --- a/editreport.php +++ b/editreport.php @@ -55,16 +55,6 @@ require_once('./includes/class_logging.php'); $log = new Logging; $log->set_bugid($bug['bugid']); -$excludeFields = array( - 'bugid', - 'lastposttime', - 'lastpostby', - 'lastpostbyname', - 'hiddenlastposttime', - 'hiddenlastpostby', - 'hiddenlastpostbyname', -); - $notif = new NotificationCenter; $bugapi = new BugAPI($bugsys); @@ -108,7 +98,7 @@ if ($_POST['do'] == 'update') $message->error_permission(); } - $log->add_data(true, $bugapi->objdata, $excludeFields, true); + $log->add_data(true, $bugapi->objdata, $log->getCommonFields(), true); // ------------------------------------------------------------------- // handle automations @@ -213,7 +203,7 @@ if ($_POST['do'] == 'update') // handle logging and perform updates $notif->set_bug_data($bugapi->objdata, $bugapi->values); - $log->add_data(false, $bugapi->values, $excludeFields, true); + $log->add_data(false, $bugapi->values, $log->getCommonFields(), true); $bugapi->update(); diff --git a/includes/class_logging.php b/includes/class_logging.php index 782eb2f..dfceac7 100644 --- a/includes/class_logging.php +++ b/includes/class_logging.php @@ -228,27 +228,22 @@ class Logging // ################################################################### /** - * Returns an array of the common fields used by the logging mechanism + * Returns an array of the fields commonly ignored * * @access public * - * @return array Fields used in logging + * @return array Fields ignored in logging */ function getCommonFields() { return array( - 'duplicateof', - 'dependency', - 'hidden', - 'summary', - 'status', - 'severity', - 'priority', - 'version', - 'assignedto' => 'assignto', - 'resolution', - 'product', - 'component' + 'bugid', + 'lastposttime', + 'lastpostby', + 'lastpostbyname', + 'hiddenlastposttime', + 'hiddenlastpostby', + 'hiddenlastpostbyname' ); } } diff --git a/search.php b/search.php index d32ce57..82cbfeb 100644 --- a/search.php +++ b/search.php @@ -518,10 +518,11 @@ if ($_POST['do'] == 'doupdate') $api = new BugApi($bugsys); $api->set('bugid', $bug['bugid']); $api->set_condition(); - + $api->values = $bug; + $log = new Logging(); $log->set_bugid($bug['bugid']); - $log->add_data(true, $bug, $log->getCommonFields()); + $log->add_data(true, $bug, $log->getCommonFields(), true); if ($bugsys->in['status'] AND can_perform('canchangestatus', $bug['product'])) { @@ -553,7 +554,7 @@ if ($_POST['do'] == 'doupdate') process_custom_fields($api, $message, false, true); - $log->add_data(false, $api->values, $log->getCommonFields()); + $log->add_data(false, $api->values, $log->getCommonFields(), true); $api->update(); $log->update_history(); -- 2.43.5