diff --git a/module/bug/control.php b/module/bug/control.php index f63282f597..706cf70434 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1296,7 +1296,17 @@ class bug extends control else { $this->bug->delete(TABLE_BUG, $bugID); - if($bug->toTask != 0) echo js::alert($this->lang->bug->remindTask . $bug->toTask); + if($bug->toTask != 0) + { + $task = $this->task->getById($bug->toTask); + if($task->deleted != '1') + { + $confirmURL = $this->createLink('task', 'view', "taskID=$bug->toTask"); + unset($_GET['onlybody']); + $cancelURL = $this->createLink('bug', 'view', "bugID=$bugID"); + die(js::confirm(sprintf($this->lang->bug->remindTask, $bug->toTask), $confirmURL, $cancelURL, 'parent', 'parent.parent')); + } + } $this->executeHooks($bugID); diff --git a/module/file/model.php b/module/file/model.php index 930c3a2015..a48d187cab 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -781,9 +781,9 @@ class fileModel extends model $data->objectID = $objectID; $data->objectType = $objectType; $data->extra = 'editor'; - if(isset($_SESSION['album'][$uid]) and $_SESSION['album'][$uid]) + if(isset($_SESSION['album']['used'][$uid]) and $_SESSION['album']['used'][$uid]) { - $this->dao->update(TABLE_FILE)->data($data)->where('id')->in($_SESSION['album'][$uid])->exec(); + $this->dao->update(TABLE_FILE)->data($data)->where('id')->in($_SESSION['album']['used'][$uid])->exec(); return !dao::isError(); } }