However, when I delete a comment that's pending approval, the "comments" attribute in serendipity_entries table is decremented as if I'm deleting a published comment. If the entry so far does not have any published comments, this will give a comment count of -1 for the entry.
Deleting moderated comments
Deleting moderated comments
Just gave 0.7-beta2 a spin. Thank you for making comment moderation work in PostgreSQL. 
However, when I delete a comment that's pending approval, the "comments" attribute in serendipity_entries table is decremented as if I'm deleting a published comment. If the entry so far does not have any published comments, this will give a comment count of -1 for the entry.
However, when I delete a comment that's pending approval, the "comments" attribute in serendipity_entries table is decremented as if I'm deleting a published comment. If the entry so far does not have any published comments, this will give a comment count of -1 for the entry.
Nice catch, will look into this ASAP.
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
http://blog.dreamcoder.dk
The same problem is still in 0.7-rc1.
I've finally gotten my act together to track it down. The glitch is in serendipity_functions.inc.php, and here's the patch.
All the patch changes is it sets $single to true explicitly when calling serendipity_db_query() to check the approval status of the comment, so that a simple associated array (not an array of an array) will be returned. (The code that follows expects $sql to be a simple array.)
I've just tried creating and deleting a few unapproved comments in my own blog, and it seems to work fine.
I've finally gotten my act together to track it down. The glitch is in serendipity_functions.inc.php, and here's the patch.
Code: Select all
--- serendipity_functions.inc.php.good 2004-10-21 22:51:48.000000000 +0800
+++ serendipity_functions.inc.php 2004-10-21 22:52:30.000000000 +0800
@@ -1476,7 +1476,7 @@
$sql = serendipity_db_query("SELECT status FROM {$serendipity['dbPrefix']}comments
WHERE entry_id = '". (int)$entry_id ."'
AND id = '". (int)$id ."'
- $admin");
+ $admin", true);
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}comments
WHERE entry_id = '". (int)$entry_id ."'I've just tried creating and deleting a few unapproved comments in my own blog, and it seems to work fine.
Thanks, committed to CVSgriffinn wrote:The same problem is still in 0.7-rc1.
I've finally gotten my act together to track it down. The glitch is in serendipity_functions.inc.php, and here's the patch.All the patch changes is it sets $single to true explicitly when calling serendipity_db_query() to check the approval status of the comment, so that a simple associated array (not an array of an array) will be returned. (The code that follows expects $sql to be a simple array.)Code: Select all
--- serendipity_functions.inc.php.good 2004-10-21 22:51:48.000000000 +0800 +++ serendipity_functions.inc.php 2004-10-21 22:52:30.000000000 +0800 @@ -1476,7 +1476,7 @@ $sql = serendipity_db_query("SELECT status FROM {$serendipity['dbPrefix']}comments WHERE entry_id = '". (int)$entry_id ."' AND id = '". (int)$id ."' - $admin"); + $admin", true); serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}comments WHERE entry_id = '". (int)$entry_id ."'
I've just tried creating and deleting a few unapproved comments in my own blog, and it seems to work fine.
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
http://blog.dreamcoder.dk