X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/05c560470887c86a30c82360d7be5caf0de1baa4..a257ef8b6e9d435938803471bd655be9d9734370:/issue/index.php diff --git a/issue/index.php b/issue/index.php index a4b1314..35a1116 100644 --- a/issue/index.php +++ b/issue/index.php @@ -59,14 +59,11 @@ if ($_POST and isset($_POST['subject'])) { if (!$row->id) { throw new Exception('Issue niet goed opgeslagen.'); } - $query = $Db->set('comments', [ - 'page' => "{$Page->handler}/{$row->id}", - 'raw' => $_POST['body'], - 'message' => messagehtml($_POST['body']), - 'author' => $User->login, - ]); - if (!$query->rowCount()) { - throw new Exception('Issueinhoud niet opgeslagen.'); + try { + createcomment($_POST, $row); + } + catch (Exception $e) { + throw new Exception("Issueinhoud niet opgeslagen: {$e->getMessage()}."); } $_POST = []; } @@ -78,7 +75,7 @@ $sql = "SELECT $cols FROM issues i WHERE page = ?"; if (isset($_GET['open'])) { $sql .= ' AND closed IS NULL'; } -$sql .= ' ORDER BY closed IS NOT NULL, updated DESC'; +$sql .= ' ORDER BY updated DESC'; $query = $Db->query($sql, [$Page->handler]); if ($id == 'feed') {