diff --git a/module/bug/model.php b/module/bug/model.php index 6ba7e80313..d4454ac0c1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -113,7 +113,7 @@ class bugModel extends model ->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedTo', $oldBug->openedBy) ->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedDate', $now) ->setIF($this->post->resolution == '' and $this->post->resolvedDate =='', 'status', 'active') - ->setIF($this->post->story != $oldBug->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->setIF($this->post->story != false and $this->post->story != $oldBug->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->get(); $this->dao->update(TABLE_BUG)->data($bug) diff --git a/module/task/model.php b/module/task/model.php index f2f6d70c39..537b6a9de5 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -60,7 +60,7 @@ class taskModel extends model ->specialChars('desc') ->cleanFloat('estimate, left, consumed') ->setDefault('story, estimate, left, consumed', 0) - ->setIF($this->post->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->setIF($this->post->story != false and $this->post->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->setIF($this->post->status == 'done', 'left', 0) ->setDefault('statusCustom', strpos(self::CUSTOM_STATUS_ORDER, $this->post->status) + 1) ->remove('comment') diff --git a/module/testcase/model.php b/module/testcase/model.php index 23702217fc..880796c8b3 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -126,7 +126,7 @@ class testcaseModel extends model ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) ->add('version', $version) - ->setIF($this->post->story != $oldCase->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->setIF($this->post->story != false and $this->post->story != $oldCase->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) ->setDefault('story', 0) ->stripTags('title') ->remove('comment,steps,expects')