diff --git a/db/update11.2.sql b/db/update11.2.sql new file mode 100644 index 0000000000..7939b8cfd6 --- /dev/null +++ b/db/update11.2.sql @@ -0,0 +1 @@ +update `zt_build` set `deleted`='1' where `project`='0' and `id` in (select `build` from `zt_release` where `deleted`='1'); diff --git a/module/release/control.php b/module/release/control.php index b944bf7f6c..ed06532073 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -191,6 +191,10 @@ class release extends control { $this->release->delete(TABLE_RELEASE, $releaseID); + $release = $this->dao->select('*')->from(TABLE_RELEASE)->where('id')->eq((int)$releaseID)->fetch(); + $build = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->eq((int)$release->build)->fetch(); + if(empty($build->project)) $this->loadModel('build')->delete(TABLE_BUILD, $build->id); + /* if ajax request, send result. */ if($this->server->ajax) {