diff --git a/module/build/js/create.js b/module/build/js/create.js index 836d749f35..24e9448c82 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -8,7 +8,7 @@ $().ready(function() $(document).on('change', '#product, #branch', function() { var productID = $('#product').val(); - var branch = $('#branch').val(); + var branch = $('#branch').length > 0 ? $('#branch').val() : ''; $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=' + branch + '&index=&needCreate=&type=noempty,notrunk,separate,noproject&extra=multiple'), function(data) { if(data) $('#buildBox').html(data); diff --git a/module/build/model.php b/module/build/model.php index 85e09241a4..695656a2f1 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -232,7 +232,7 @@ class buildModel extends model ->leftJoin(TABLE_RELEASE)->alias('t3')->on("FIND_IN_SET(t1.id,t3.build)") ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->leftJoin(TABLE_PRODUCT)->alias('t5')->on('t1.product = t5.id') - ->where(1)->eq(1) + ->where('1=1') ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'noproject') !== false)->andWhere('t1.execution')->ne(0)->fi() ->beginIF($products)->andWhere('t1.product')->in($products)->fi() diff --git a/module/release/model.php b/module/release/model.php index a8ea3e9d24..2f08f19efc 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -168,11 +168,10 @@ class releaseModel extends model $release = fixer::input('post') ->add('product', (int)$productID) ->add('branch', (int)$branch) - ->add('stories', '') - ->add('bugs', '') ->setIF($projectID, 'project', $projectID) ->setIF($this->post->build == false, 'build', 0) ->setDefault('stories', '') + ->setDefault('bugs', '') ->setDefault('createdBy', $this->app->user->account) ->setDefault('createdDate', helper::now()) ->join('build', ',') @@ -312,6 +311,7 @@ class releaseModel extends model $release = fixer::input('post')->stripTags($this->config->release->editor->edit['id'], $this->config->allowedTags) ->add('id', $releaseID) + ->setDefault('build', '') ->setDefault('mailto', '') ->setDefault('deleteFiles', array()) ->join('build', ',')