Numbered week links on side of Month view don't work...

dcasey - July 17, 2009 - 21:48
Project:Calendar
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:link, week column
Description

Numbered week links on side of Month view don't work like Year Month Day Prev Next links. It doesn't consider the URL like the others do.

I have a taxonomy term inserted in the URL: calendar/term/2009-07

I didn't dig too deeply, but maybe it doesn't use date_real_url()?

#1

VladRM - August 28, 2009 - 07:19

Hello,

I have the same problem.

The weekno links are built in:
- calendar.inc
-> function calendar_build_week(&$curday, $view, $items, $check_month = FALSE) {...}
-> line 97: $url = $view->get_path() .'/'. $view->date_info->year .'-W'. $week;

I did a dirty hack but this is clearly not the right way to go:

<?php
    $url
= $view->get_path() .'/'. $view->date_info->year .'-W'. $week;
    if(isset(
$view->argument['term_node_tid_depth'])) { // hack
      
$url = $view->get_path() .'/'. $view->args[0] .'/'. $view->date_info->year .'-W'. $week;
    }
?>

Please help fix this issue.

#2

jjemmett - November 5, 2009 - 18:11

Here is a patch we use to fix this issue. As the original poster noted, date_real_url is not being used when it should be.

--- includes/calendar.inc.old   2009-11-05 10:10:15.000000000 -0700
+++ includes/calendar.inc       2009-11-05 10:11:01.000000000 -0700
@@ -94,7 +94,7 @@ function calendar_build_week(&$curday, $
   // If we're displaying the week number, add it as the
   // first cell in the week.
   if (!empty($view->date_info->style_with_weekno) && !in_array($view->date_info->granularity, array('day', 'week'))) {
-    $url = $view->get_path() .'/'. $view->date_info->year .'-W'. $week;
+    $url=date_real_url($view,NULL,$view->date_info->year .'-W'. $week);
     if (!empty($view->date_info->display_types['week'])) {
       $weekno = l($week, $url, array('query' => !empty($view->date_info->append) ? $view->date_info->append : ''));
     }

AttachmentSize
calendar-552914-1.patch 743 bytes

#3

jjemmett - November 6, 2009 - 14:29
Status:active» needs review

changing status to 'needs review'

#4

Gribnif - November 6, 2009 - 22:21

Works for me. RTBC, IMHO.

 
 

Drupal is a registered trademark of Dries Buytaert.