Count incorrect ...
nimzie - September 8, 2008 - 20:14
| Project: | Archive |
| Version: | 5.x-1.11 |
| Component: | Block |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I've got the module plugged in.. It's only filtering blog postings, yet the count is showing me 92 documents.
How to fix?
Thanks,
Adam

#1
I'm not positive that the block filters out the content like the archive listing page does.
Is the count on the archive listing page correct?
#2
The count on the archive listing page looks OK. The Archive block does what I need (subnav for archived content) so I would like to be able to use this one.
I'm not sure what you mean by "I'm not positive that the block filters out the content like the archive listing page does." ... can it?
#3
What I meant was I don't think the blocks respect filters defined on the settings page, and that indeed appears to be the case. The blocks need to respect that setting.
#4
Any idea how to patch/fix this ?
#5
Not off the top of my head, I haven't looked at the code in a while. You'd just need to compare the database queries (calls to
db_query()) from the main page to the one used by the block and see what the problem is.#6
So - in theory, should the call to db_query in archive_month_list be the same as _archive_post_count or vice versa?
Thanks for your help.
Adam
#7
archive_month_listshould probably use the same code as_archive_post_count, though it might need to be tweaked because they do different things.archive_month_list()tries to find the post count per month for the last X months while_archive_post_count()only does that for months that are in this current calendar year.#8
Hmm, I've looked in to this and am not really comfortable with my understanding of how to alter things and not break them. Is there any chance you'd be able to have a look or at least let me know how to remove the count from the returned information so at least what I am seeing isn't inaccurate?
Thanks for your help either way.
#9
Change the line that looks like:
$links[] = l(t($data['month_name'] . ' ' . $year), 'archive/all/' . $year . '/' . $month, array('title' => format_plural($data['count'], '1 post', '@count posts')));to
$links[] = l(t($data['month_name'] . ' ' . $year), 'archive/all/' . $year . '/' . $month);#10
Thanks, that works just fine. If you decide to fix that, please drop me a line. It's a great module. Cheers.
#11
This will be fixed in the future at some point and it'll include a new release, so the status_update.module will alert you.