Archive month listing block displays months with no nodes

nimzie - September 8, 2008 - 20:11
Project:Archive
Version:5.x-1.11
Component:Block
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I've got the archive module archiving my blog nodes only. I've got one blog article which was created Sept 05 yet the archive navigation is showing me Aug and Sept as months. Is there a way to set things so only months with archived nodes show?

Thanks for your support.

Cheers,

Adam

#1

Susurrus - September 9, 2008 - 17:07
Status:active» postponed (maintainer needs more info)

Which archive block are you using? The calendar or the month listing?

Does the archive listing page work correctly? (http://www.example.com/archive)

#2

nimzie - September 9, 2008 - 17:32

I am using the archive block, not the calendar block.

When I go to www.site.com/archive, it just gives me the all/2008 filters and they do appear to work properly, however with no 2007 or 2009 data, I am unable to verify.

#3

Susurrus - September 9, 2008 - 17:51
Status:postponed (maintainer needs more info)» active

So it just looks like the code for the blocks needs to be synced up with the code for the archive listing page.

#4

nimzie - September 9, 2008 - 17:58

I think - but I am not sure how to do this ... am learning my way in Drupal, however hacking certain things is a little foreign to me ... filters and syncing may just be one of those things....

#5

Susurrus - September 9, 2008 - 18:03

I know the issue, so I'll get to it within the next few weeks. By sync I mean just that the code needs to be the same, filtering is just database stuff.

#6

choices - September 29, 2008 - 18:01
Title:Showing Months with no appliable nodes...» Having the same issue with Archive

Have you made any headway on this? Clicking on a month in the listing, when there are no filtered nodes for that month, results in a listing of all the nodes, since the month argument gets dropped from the path.
I.e., because the archive module generates the path 'archive/all/2008/6' and there are no nodes for June, it returns 'archive/all/2008'.
This is a nice module. Once this issue is resolved it will be perfect for my needs.
Thanks.

#7

Susurrus - September 30, 2008 - 02:27
Title:Having the same issue with Archive» Archive month listing block displays months with no nodes

The system was designed such that if any specific date doesn't have any nodes, it keeps moving to more general dates until it finds one with nodes, so that's by design. The issue is that the archive listing block shows the wrong months, not that the links don't go to the right place.

Also, please don't change the title of issues to something incredibly non-descriptive. How is this new title helpful?

#8

michaek - April 6, 2009 - 21:13

The most likely reason the months list is incorrect is that the query isn't filtering for node types that are set to be displayed in Archive pages (which do filter correctly).

The following is missing from the node query in archive_month_list():

AND n.type IN ('". implode("', '", variable_get('archive_type_filters', array())) ."')

#9

cakka - September 7, 2009 - 04:33

So, how to clearing this problem ?
thanks

 
 

Drupal is a registered trademark of Dries Buytaert.