ChangeSet ID: 31073 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner@winehq.org 2007/04/21 13:05:32
Modified files: include : comment.php
Log message: Alexander Nicolaysen Sørnes alex@thehandofagony.com Fix comment creation. addcomment.php was passing a filled-in object to comment::create() which still expected values as parameters. Load data from the object instead
Patch: http://cvs.winehq.org/patch.py?id=31073
Old revision New revision Changes Path 1.35 1.36 +8 -4 appdb/include/comment.php
Index: appdb/include/comment.php diff -u -p appdb/include/comment.php:1.35 appdb/include/comment.php:1.36 --- appdb/include/comment.php:1.35 21 Apr 2007 18: 5:32 -0000 +++ appdb/include/comment.php 21 Apr 2007 18: 5:32 -0000 @@ -55,11 +55,14 @@ class Comment { * Informs interested people about the creation. * Returns true on success, false on failure */ - function create($sSubject, $sBody, $iParentId=null, $iVersionId) + function create() { - $hResult = query_parameters("INSERT INTO appComments (parentId, versionId, subject, ". - "body, userId, time, hostname) VALUES ('?', '?', '?', '?', '?', ?, '?')", - $iParentId, $iVersionId, $sSubject, $sBody, + $hResult = query_parameters("INSERT INTO appComments + (parentId, versionId, subject, ". + "body, userId, time, hostname) + VALUES ('?', '?', '?', '?', '?', ?, '?')", + $this->iParentId, $this->iVersionId, + $this->sSubject, $this->sBody, $_SESSION['current']->iUserId, "NOW()", get_remote());
@@ -71,6 +74,7 @@ class Comment {
// fetches e-mails from parent comments, all parents are notified that a // comment was added to the thread + $iParentId = $this->iParentId; while($iParentId) { $oParent = new Comment($iParentId);