From 498a2bd4b03e7d1327570660110dea2f676a36a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sun, 2 Mar 2008 23:19:28 +0100 Subject: [PATCH] testData: Fix moving of test results --- include/testData.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/testData.php b/include/testData.php index 6556896..ed24ead 100644 --- a/include/testData.php +++ b/include/testData.php @@ -190,12 +190,7 @@ class testData{ if($oNewVersion->objectGetState() == 'accepted' && $this->sState == 'pending') $this->sState = 'queued'; - if($this->sState == 'accepted') - { - $oOldVersion = new version($oOldTest->iVersionId); - $oOldVersion->updateRatingInfo(); - $oNewVersion->updateRatingInfo(); - } + $bUpdateRatingInfo = true; } if(query_parameters("UPDATE testResults SET @@ -227,7 +222,14 @@ class testData{ $this->iTestingId)) { if($bUpdateRatingInfo && $this->sState == 'accepted') + { + if($this->iVersionId != $oOldTest->iVersionId) + { + $oNewVersion = new version($this->iVersionId); + $oNewVersion->updateRatingInfo(); + } $oVersion->updateRatingInfo(); + } if(!$bSilent) $this->SendNotificationMail("edit", $sWhatChanged);