From 5d6609181de5337cfbff3c9f77f38bb09097f45f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 10 Nov 2017 11:23:22 +0800 Subject: [PATCH] * fix bug #1265. --- module/bug/control.php | 1 - module/bug/model.php | 3 +-- module/story/model.php | 5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 632ef2300c..6c631f5557 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -414,7 +414,6 @@ class bug extends control $title = $file['title']; $titles[$title] = $fileName; } - krsort($titles); $this->view->titles = $titles; } diff --git a/module/bug/model.php b/module/bug/model.php index 0e9fc9016c..31ef282a55 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -182,9 +182,8 @@ class bugModel extends model $file['addedDate'] = $now; $this->dao->insert(TABLE_FILE)->data($file)->exec(); - $fileID = $this->dao->lastInsertID; + $fileID = $this->dao->lastInsertID(); $bug->steps .= ''; - unset($file); } } else diff --git a/module/story/model.php b/module/story/model.php index eb94ccc1bf..60eaacccc7 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -326,8 +326,11 @@ class storyModel extends model { $file['addedBy'] = $this->app->user->account; $file['addedDate'] = $now; + $file['objectType'] = 'story'; + $file['objectID'] = $storyID; if(in_array($file['extension'], $this->config->file->imageExtensions)) { + $file['extra'] = 'editor'; $this->dao->insert(TABLE_FILE)->data($file)->exec(); $fileID = $this->dao->lastInsertID(); @@ -335,8 +338,6 @@ class storyModel extends model } else { - $file['objectType'] = 'story'; - $file['objectID'] = $storyID; $this->dao->insert(TABLE_FILE)->data($file)->exec(); } }