From 19d1393fe5bfcb5fb1dd8c306455e5fd2d8defa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sat, 21 Apr 2007 18:22:14 +0000 Subject: [PATCH] Fix testData_queue's distribution handling. Only update the distribution if the name is set and avoid a misguiding message by not doing unQueue() on already unqueued distributions. --- include/testData_queue.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/testData_queue.php b/include/testData_queue.php index 3b6cdbf..8249619 100644 --- a/include/testData_queue.php +++ b/include/testData_queue.php @@ -37,7 +37,10 @@ class testData_queue function unQueue() { $this->oTestData->unQueue(); - $this->oDistribution->unQueue(); + + /* Avoid a misguiding message about the distribution being unqueued */ + if($this->oDistribution->sQueued != "false") + $this->oDistribution->unQueue(); } function reject() @@ -48,7 +51,13 @@ class testData_queue function update() { $this->oTestData->update(); - $this->oDistribution->update(); + + /* If the distribution was already un-queued the form for editing it would + not have been displayed and getOutputEditorValues() wouldn't have + retrieved a valid sName for the distribution. If sName isn't valid + we shouldn't update the distribution */ + if($this->oDistribution->sName) + $this->oDistribution->update(); } function outputEditor()