Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
sixf00t4
Regular
Regular



Joined: Nov 05, 2006
Posts: 96

PostPosted: Sun Nov 23, 2008 1:43 pm Reply with quote

take a look at the last story, http://www.joshuadhall.com/article-topic17-page7.html It says there are 2 comments, but when you click to view it, there are no comments. Nothing in the DB for that story ID under comments. I don't see any other story with comments in the link, but no comments...

Ideas?

_________________
Only registered users can see links on this board! Get registered or login! - Only registered users can see links on this board! Get registered or login! - Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Sun Nov 23, 2008 3:48 pm Reply with quote

Have you removed any comments from that article?
 
View user's profile Send private message
jestrella
Moderator



Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic

PostPosted: Sun Nov 23, 2008 10:58 pm Reply with quote

I think you should compare database to the standard installation and check for any differences between them...

_________________
"For those whom have not reach the sky... Every mountain seems high"

Best Regards
Jonathan Estrella
http://about.me/jestrella04 
View user's profile Send private message Visit poster's website
jestrella







PostPosted: Sun Nov 23, 2008 10:59 pm Reply with quote

Checked site.. it says two comments and two comments are present. So what's the deal???
 
jakec







PostPosted: Mon Nov 24, 2008 12:56 am Reply with quote

Jestrella, yeah I thought that when I first looked at it, but it's the 2nd post you need to look at, the one titled "Ouch". Wink
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Nov 24, 2008 11:10 am Reply with quote

I think there is another one on a different page, but I can't remember the page.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
sixf00t4







PostPosted: Mon Nov 24, 2008 11:58 am Reply with quote

I can't remember if I've ever deleted a comment on that story, but certainly not in any recent time. It shouldn't be any page caching issue.

So now I go look at the db structure, and I see that there is a comments field in the stories table.

Should we get rid of that field and create a sql query to get the number of comments? Otherwise you have to have more code execute when you delete comments.
 
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Mon Nov 24, 2008 1:07 pm Reply with quote

The code in /modules/news/index.php that determines what you see on the number of comments on the home page of news (in "morelink") is taken from the value of the comments field in the stories table (as you say). Then the actual comments are taken from the comments table. Obviously the the number in the comments field in the stories table should match the number of rows you get when you query the comments table for a given story id. And something went wrong in your system to cause those to differ ... whether it was a database error or someone manually deleting comments through PHPmyadmin or a bug.

As you say, it is a little more work when you delete comments to update the count in the stories table. On the other hand it would be an little extra work on news/index.php to have to go out and count the number of rows in the comments table. No big deal either way in terms of overhead -- considering all the other overhead that takes place when a *nuke page loads. Probably a better argument for eliminating the comments field from the stories table would be the possibility of error as you are seeing here. There is no built in relational integrity in any *nuke system that I know of -- so if the programs don't work properly the two "related" fields can easily get out of synch. Likewise there is no transactional integrity ... one table can get updated and then the system crashes and there is no backout of uncompleted transactions.

However, making the change you suggest would mean going through all the code to find any other places where the comments field in the stories table is used and adjusting all of these. It would also mean changes to the load sql and the upgrade programs and probably other things as well. I'm not saying that means we shouldn't do it but just that it needs to be considered carefully and prioritized along with other possible changes for RN2.4.
 
View user's profile Send private message Visit poster's website
sixf00t4







PostPosted: Mon Nov 24, 2008 1:15 pm Reply with quote

definitely an undertaking.

I definitely have used phpmyadmin when i got a spam commenter to numerous stories at once. quick and simple.
 
fkelly







PostPosted: Mon Nov 24, 2008 2:26 pm Reply with quote

Quick and simple but unless you updated both tables involved (stories and comments) you could wind up with the situation you described at the beginning of the thread. It wouldn't be that complicated to write a script that would read each story, see how many comments it had and then check the comments table for that story and see if the number of comments corresponded. Alternatively and perhaps better, read the comments table in order by story id and accumulate the number of comments for each story, then when you are done with that story in the comments table, check the story table and see if the comments field number corresponds. If it doesn't fix it. Hey, that almost sounds like specs.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Nov 25, 2008 5:46 am Reply with quote

sixf00t4 wrote:
definitely an undertaking.

I definitely have used phpmyadmin when i got a spam commenter to numerous stories at once. quick and simple.


Even better, use RN's built in Comments administration tool to do this... and to keep an eye on potential spam.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
sixf00t4







PostPosted: Wed Nov 26, 2008 12:46 pm Reply with quote

montego wrote:
sixf00t4 wrote:
definitely an undertaking.

I definitely have used phpmyadmin when i got a spam commenter to numerous stories at once. quick and simple.


Even better, use RN's built in Comments administration tool to do this... and to keep an eye on potential spam.


well, sure, with 2.3, that's easy. This was not the case 3 years ago. We've come a long way since then.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©