The year designation dropdown control on the "archive" selection page will not display the year 2006.

In addition, when the year 2006 is accessed from the archive/calendar block, the archived node display page shows the year 2000.

spritefully yours

Comments

sprite’s picture

Title: archive.module - cannot access 2006 dates ... » archive.module - cannot access 2006 dates (bug is caused by hardcoded date range) ...

The problem is caused by the hardcoded date range handling in archive.module.
Someone hacked it recently to extend the date to 2010, but that is an inappropriate hack that will only cause it to break again later. (remember the Y2K bug people??)

User lcd_47 provided a proper bug fix the other day that assembles the date range dynamically.

http://drupal.org/node/51801

// Prepare the values of the form fields.
  $years = drupal_map_assoc(range(2000, 2010));
  $months = array(1 => t('January'), 2 => t('February'), 3 => t('March'), 4 => t('April'), 5 => t('May'), 6 => t('June'), 7 => t('July'), 8 => t('August'), 9 => t('September'), 10 => t('October'), 11 => t('November'), 12 => t('December'));
  $days = drupal_map_assoc(range(0, 31));
   // Prepare the values of the form fields.
-  $years = drupal_map_assoc(range(2000, 2005));
+  $eyear = date('Y', time());
+  $eyear = $eyear < $year ? $year : $eyear;
+  $syear = $eyear - 5;
+  $syear = $syear > $year ? $year : $syear;
+  $years = drupal_map_assoc(range($syear, $eyear));
   $months = array(1 => t('January'), 2 => t('February'), 3 => t('March'), 4 => t('April'), 5 => t('May'), 6 => t('June'), 7 => t('July'), 8 => t('August'), 9 => t('September'), 10 => t('October'), 11 => t('November'), 12 => t('December'));
   $days = drupal_map_assoc(range(0, 31));

See:
http://drupal.org/files/issues/patch.archive

spritefully yours

FlemmingLeer’s picture

it didn´t make it into drupal 4.6.6.

Could someone create a CVS version of this patch ?

gábor hojtsy’s picture

Status: Active » Fixed

A fix is in 4.6.x and 4.7.x. It is as simple as replacing 2010 with date('Y'). Marking as fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)