Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I found out that on my date views with a pager the previous week link was not correctly generated... the week number was always 00.
The mistake was here:
date/date_views/theme/theme.inc - line 75ff.:
case 'week':
$next_week = date_week(date_format($next_date, 'Y-m-d'));
$prev_year = (date_format($prev_date, 'n') == 12 && $prev_week == 1) ? date_format($prev_date, 'Y') + 1 : date_format($prev_date, 'Y');
$prev_arg = $prev_year . '-W' . date_pad($prev_week);
$next_year = (date_format($next_date, 'n') == 12 && $next_week == 1) ? date_format($next_date, 'Y') + 1 : date_format($next_date, 'Y');
$next_arg = $next_year . '-W' . date_pad($next_week);
break;
needs to be
case 'week':
$prev_week = date_week(date_format($prev_date, 'Y-m-d'));
$next_week = date_week(date_format($next_date, 'Y-m-d'));
$prev_year = (date_format($prev_date, 'n') == 12 && $prev_week == 1) ? date_format($prev_date, 'Y') + 1 : date_format($prev_date, 'Y');
$prev_arg = $prev_year . '-W' . date_pad($prev_week);
$next_year = (date_format($next_date, 'n') == 12 && $next_week == 1) ? date_format($next_date, 'Y') + 1 : date_format($next_date, 'Y');
$next_arg = $next_year . '-W' . date_pad($next_week);
break;
see the $prev_week = date_week(date_format($prev_date, 'Y-m-d'));
in first line. I will try to write a patch during the day.
Best,
Tobias
Comments
Comment #1
tobiberlinI am sorry - I found out that someone changed this code directly in the module's theme.inc file instead of overriding the code in a custom template.php. It is not really an issue of this module but of the project I work currently on. stupid