Comment Deletion Bug

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

Comment Deletion Bug

Postby Scully » Sat Aug 11, 2012 3:20 am

Hello

My blog only gets spam comments and as such, I delete them (they never actually appear as I have it set up so they have to be approved). Problem is, the number of comments never gets updated against an entry, so one of my entries still claims to have 80-odd comments.

I've looked into the source code and the problem appears to be in the method called deleteComments in module_comments.php - in here, it deletes the comments from the comments table, but never updates the comment_count column on the entries table.

Hopefully you can include a fix in the next release. Though, (and this will be more work) it would be nice if the number of comments shown against an entry was the number of approved comments, as this may lead to confusion if someone sees 20 comments when PivotX reckons that there are in fact 23, for example.

Take care
Scully
Scully
 
Posts: 7
Joined: Sun Jul 26, 2009 2:09 am

Re: Comment Deletion Bug

Postby Harm10 » Sat Aug 11, 2012 10:00 am

I am on version 2.3.3 (MySQL) and cannot reproduce your problem. When I moderate a comment by deleting it the total number of comments displayed is lowered.
You have a point about the total number while comments are in moderation but as it is displayed together with the existing moderated comments that there are comments to be moderated you could reason that displaying the total number including those to be moderated is correct.
So on what version are you?
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Comment Deletion Bug

Postby Scully » Sat Aug 11, 2012 2:32 pm

I'm on the same version of PivotX. Hmm, I looked at the code on my laptop last night (not on it now, so will have to look again another time) and it seemed to run an SQL query to delete comments but not update the total on the entries.

To be fair, until I saw that bit of code last night, I'd always thought that updating the total comments remaining after deletion was flaky - meaning it sometimes seemed to work and sometimes it didn't update the total at all and sometimes it updated it, but not to the correct number. Though I wouldn't swear by that, it was just the impression I got an the code seemed to contradict that entirely.

I'll post further once I'm back on my laptop. Cheers for the reply.
Scully
 
Posts: 7
Joined: Sun Jul 26, 2009 2:09 am

Re: Comment Deletion Bug

Postby Scully » Fri Oct 12, 2012 9:30 pm

Hello Harm10

A massive delay, but I think I know what the problem is - I'm not just deleting a comment one by one, I have PivotX setup so that I have to approve comments before they are shown on my site. I then go to the moderate comments section, within admin, click select all and then delete. All the comments are deleted, but the figures within the entries table are not updated.

However, if you delete a comment one by one, the comment count is updated.

Take care
Scully
Scully
 
Posts: 7
Joined: Sun Jul 26, 2009 2:09 am

Re: Comment Deletion Bug

Postby maronno » Wed Jun 26, 2013 6:39 pm

I run into the same issue. So the only way to get the count right is to delete one at a time?

____________________________________________________________________________
Free hosting
Last edited by maronno on Mon Sep 16, 2013 7:29 am, edited 1 time in total.
maronno
 
Posts: 1
Joined: Wed Jun 26, 2013 6:33 pm

Re: Comment Deletion Bug

Postby Harm10 » Wed Jun 26, 2013 7:39 pm

I have no real clue but if the count is not right after mass deletion you can always give it the right count through sqladmin.
Sorry there is no better solution at this moment.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 3 guests

cron