Home » Drupal » Drupal Calendar 0000 glitch

Drupal Calendar 0000 glitch

If you use the Drupal calendar module and wonder why the navigation links always link to the year 0000, there is a simple fix. Open up the file sites/all/modules/calender/theme/theme.inc and after this stanza (lines 19-23):

// Create the links to other displays.
$now = date_now();
$url = $view->get_url();
$view->date_info->url = $url;
$arg = $view->date_info->date_arg;

add the following line:

$view->date_info->year = $view->date_info->year && $view->date_info->year != $view->argument['date_argument']->options['wildcard'] ? $view->date_info->year : date_format($now, 'Y');

3 thoughts on “Drupal Calendar 0000 glitch

  1. Hi mcmlxxii,

    Thanks for that. Could you kindly tell me what change I should make in the D7 version (7.2 alpha) calendar to ensure that the glitch does not happen?



  2. Thanks – I got it! Not very different. Only that $now should be changed to $current_date and should be placed at a later point, before the check for other variables

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>