Only create new distributions if the user didn't pick one from the dropdown menu. Previous behavior would create a new distribution if any text was present in the 'distribution' textbox, even if a distribution is picked from the dropdown menu.
This commit is contained in:
@@ -181,7 +181,8 @@ if ($_REQUEST['sub'])
|
|||||||
{
|
{
|
||||||
$oVersion->create();
|
$oVersion->create();
|
||||||
}
|
}
|
||||||
|
if(!$_REQUEST['iDistributionId'])
|
||||||
|
{
|
||||||
$sDistribution = trim($_REQUEST['sDistribution']);
|
$sDistribution = trim($_REQUEST['sDistribution']);
|
||||||
if(!empty($sDistribution))
|
if(!empty($sDistribution))
|
||||||
{
|
{
|
||||||
@@ -190,6 +191,7 @@ if ($_REQUEST['sub'])
|
|||||||
$oDistribution->create();
|
$oDistribution->create();
|
||||||
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$oTest->iVersionId = $oVersion->iVersionId;
|
$oTest->iVersionId = $oVersion->iVersionId;
|
||||||
if(is_numeric($oTest->iTestingId))
|
if(is_numeric($oTest->iTestingId))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ if ($_REQUEST['sub'])
|
|||||||
$errors = $oTest->CheckOutputEditorInput();
|
$errors = $oTest->CheckOutputEditorInput();
|
||||||
$oTest->GetOutputEditorValues(); // retrieve the values from the current $_REQUEST
|
$oTest->GetOutputEditorValues(); // retrieve the values from the current $_REQUEST
|
||||||
if(empty($errors))
|
if(empty($errors))
|
||||||
|
{
|
||||||
|
if(!$_REQUEST['iDistributionId'])
|
||||||
{
|
{
|
||||||
$sDistribution = trim($_REQUEST['sDistribution']);
|
$sDistribution = trim($_REQUEST['sDistribution']);
|
||||||
if(!empty($sDistribution))
|
if(!empty($sDistribution))
|
||||||
@@ -35,6 +37,7 @@ if ($_REQUEST['sub'])
|
|||||||
$oDistribution->create();
|
$oDistribution->create();
|
||||||
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
$oTest->iDistributionId = $oDistribution->iDistributionId;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if($_REQUEST['sub'] == 'Submit')
|
if($_REQUEST['sub'] == 'Submit')
|
||||||
{
|
{
|
||||||
$oTest->create();
|
$oTest->create();
|
||||||
|
|||||||
Reference in New Issue
Block a user