[AppDB] Favor distributions selected from list over textboxes

Rosanne DiMesio dimesio at earthlink.net
Wed Jul 12 10:07:59 CDT 2017


When a distribution has been selected from the dropdown list, anything
typed in the add distribution textboxes is a mistake. Also corrects a typo that prevented the notice that the user had added a new distribution from displaying fully.

Signed-off-by: Rosanne DiMesio <dimesio at earthlink.net>
---
 include/testData.php | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/testData.php b/include/testData.php
index 051ef65..8dac819 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -814,7 +814,7 @@ class testData{
                                      "please add it using the form below.";
             } else
             {
-                $sDistributionHelp = "The user added a new distribution; ";
+                $sDistributionHelp = "The user added a new distribution; ".
                                      "review it in the form below or replace ".
                                      "it with one from the list.";
             }
@@ -825,7 +825,7 @@ class testData{
 
         echo '<td class=color0>',"\n";
         echo $sDistributionHelp;
-        distribution::make_distribution_list("iDistributionId", $this->iDistributionId);
+        distribution::make_distribution_list("iTestDistributionId", $this->iDistributionId);
         echo '</td></tr>',"\n";
 
         // Version List
@@ -927,7 +927,7 @@ class testData{
         }
 
         // No Distribution entered, and nothing in the list is selected
-        if (empty($aValues['sDistribution']) && !$aValues['iDistributionId'])
+        if (empty($aValues['sDistribution']) && !$aValues['iTestDistributionId'])
             $errors .= "<li>Please enter a distribution.</li>\n";
 
         if (empty($aValues['sInstalls']))
@@ -973,7 +973,13 @@ class testData{
         $this->shWhatDoesnt = $aValues['shWhatDoesnt'];
         $this->shWhatNotTested = $aValues['shWhatNotTested'];
         $this->sTestedDate = $aValues['sTestedDate'];
-        $this->iDistributionId = $aValues['iDistributionId'];
+        
+        //Favor distribution dropdown list selections over textboxes.
+        if($aValues['iTestDistributionId'])
+            $this->iDistributionId = $aValues['iTestDistributionId'];
+        else
+            $this->iDistributionId = $aValues['iDistributionId'];
+            
         $this->sTestedRelease = $aValues['sTestedRelease'];
         $this->iStaging = intval($aValues['iStaging']);
         $this->sInstalls = $aValues['sInstalls'];
-- 
2.12.3




More information about the wine-patches mailing list