1 Article, Multiple Cats, Counted Multiple Timesin Archive

Found a bug? Tell us!!
Post Reply
Allstar
Regular
Posts: 9
Joined: Fri Jul 14, 2006 8:45 pm
Contact:

1 Article, Multiple Cats, Counted Multiple Timesin Archive

Post by Allstar »

I've just done a host of posts for August ( been away to post them when I got back ).

I'm using the assign multiple categories plug and I've added all these with 2 Categories but the entry count next in the archive section is counting the entry twice, once for each category assigned.

Have I the plugins running in the wrong order or is this actually a bug?

www.gojamboree.org.uk/blog
"The price of greatness is responsibility."
Sir Winston Churchill
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 1 Article, Multiple Cats, Counted Multiple Timesin Archi

Post by garvinhicking »

Hi!

Yes, this sadly is a bug in the archives sidebar plugin. It was already reported in the german section (http://www.s9y.org/forums/viewtopic.php?t=6056) - but I'm currently clueless as to how to fix it, as the complex SQL query is hard to get the count right for all 3 Databases we support and fitting them into one single query. :-/

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

Ciao, Stephan
xzilla
Regular
Posts: 10
Joined: Wed Aug 16, 2006 5:05 pm
Contact:

Post by xzilla »

I glanced at this yesterday whilst waiting for a reply on my bug and istm the problem is that the archives code does a $serendipity['GET']['category'] before doing the count, which afaict isn't neccesary. (I think this causes the join to categories which you shouldn't really ever want to do in the archives plugin) So maybe just removing that bit would be enough? I didn't actually test this or anything, but might be worth investigating.
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

I think, that is wanted:

When you go to a category, the archive is supposed to to show only the articles of the choosen category.
Ciao, Stephan
xzilla
Regular
Posts: 10
Joined: Wed Aug 16, 2006 5:05 pm
Contact:

Post by xzilla »

Ah yes, I was thinking at the time I looked at the code some type of if statement was warrented but couldn't remember when I posted that comment. So maybe it needs to test "if category selected then $serendipity['GET']['category'] " else do nothing. Would be a simple change to test out anyway.
Allstar
Regular
Posts: 9
Joined: Fri Jul 14, 2006 8:45 pm
Contact:

Post by Allstar »

Could you not just have it go something like this?

sort order timestamp

find ( first timestamp in august )

for ( first entry in august to last entry ) {
increment archive total + 1
}

Surely it doesn't matter about the categories as the archive section is all about the number of entries between the beginning of 1 month and the next?

I'm sorry if you think I'mbeing pushy.
"The price of greatness is responsibility."
Sir Winston Churchill
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Sadly SQL doesn't work like that. :-)

We would need to fetch ALL rows just to get the total count with your prosposed algorithm, which would vastly decrease performance.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply