Updating the Drupal archive module for 2006

If you clicked on the calendar archive to the right of the page in the last couple of days you'd notice it didn't allow you to choose "2006" articles.

A quick change to archive.module and all is well. The line in question is this line:

  $years = drupal_map_assoc(range(2000, 2005));

By changing the 2005 to 2006 it again works. However a better solution would include a bit more code that checks for the current year and makes it go through the current year. To save cycles the current year could be specified in a configuration file or stored in the database though each of those has their own issues associated with it.

Category: 

1 Comment

saving cycles

to save cycles, don't use the database or a file; a normal function call to date('Y') will be sufficient, and much quicker