From a8dd17081e55980a7f48fecd9066e8f860a9930b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 13 Oct 2006 14:41:17 +0000 Subject: [PATCH] r1255: Gargh. Another stupid bug in which DATA LOSS occurs when a non-edit-empowered user tries to comment on a bug --- editreport.php | 62 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/editreport.php b/editreport.php index 5e1423c..ebfd880 100644 --- a/editreport.php +++ b/editreport.php @@ -2,7 +2,7 @@ /*=====================================================================*\ || ################################################################### || # Bugdar [#]version[#] -|| # Copyright ©2002-[#]year[#] Blue Static +|| # Copyright 2002-[#]year[#] Blue Static || # || # This program is free software; you can redistribute it and/or modify || # it under the terms of the GNU General Public License as published by @@ -140,36 +140,7 @@ if ($_POST['do'] == 'update') } } } - - // ------------------------------------------------------------------- - // do update stuff - $pcv = parse_pcv_select($bugsys->in['pcv_select'], true); - - $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); - $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies)); - - $bugapi->set('summary', $bugsys->in['summary']); - $bugapi->set('severity', $bugsys->in['severity']); - $bugapi->set('duplicateof', $bugsys->in['duplicateof']); - $bugapi->set('dependency', $dependencies); - $bugapi->set('product', $pcv['product']); - $bugapi->set('component', $pcv['component']); - $bugapi->set('version', $pcv['version']); - $bugapi->set('hidden', $bugsys->in['hidden']); - - if (can_perform('canchangestatus', $bug['product'])) - { - $bugapi->set('priority', $bugsys->in['priority']); - $bugapi->set('status', $bugsys->in['status']); - $bugapi->set('resolution', $bugsys->in['resolution']); - } - if (can_perform('canassign', $bug['product'])) - { - $bugapi->set('assignedto', $bugsys->in['assignedto']); - } - - $notif->set_bug_data($bugapi->objdata, $bugapi->values); - + // ------------------------------------------------------------------- // process comment stuff if ($bugsys->in['comment'] OR $automation['comment']) @@ -209,6 +180,35 @@ if ($_POST['do'] == 'update') } } + // ------------------------------------------------------------------- + // do update stuff + $pcv = parse_pcv_select($bugsys->in['pcv_select'], true); + + $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); + $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies)); + + $bugapi->set('summary', $bugsys->in['summary']); + $bugapi->set('severity', $bugsys->in['severity']); + $bugapi->set('duplicateof', $bugsys->in['duplicateof']); + $bugapi->set('dependency', $dependencies); + $bugapi->set('product', $pcv['product']); + $bugapi->set('component', $pcv['component']); + $bugapi->set('version', $pcv['version']); + $bugapi->set('hidden', $bugsys->in['hidden']); + + if (can_perform('canchangestatus', $bug['product'])) + { + $bugapi->set('priority', $bugsys->in['priority']); + $bugapi->set('status', $bugsys->in['status']); + $bugapi->set('resolution', $bugsys->in['resolution']); + } + if (can_perform('canassign', $bug['product'])) + { + $bugapi->set('assignedto', $bugsys->in['assignedto']); + } + + $notif->set_bug_data($bugapi->objdata, $bugapi->values); + // ------------------------------------------------------------------- // handle logging and perform updates -- 2.22.5