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()?

CommentFileSizeAuthor
#2 calendar-552914-1.patch743 bytesjjemmett
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VladRM’s picture

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:

    $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.

jjemmett’s picture

Issue tags: +link, +week column
FileSize
743 bytes

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 : ''));
     }
jjemmett’s picture

Status: Active » Needs review

changing status to 'needs review'

Gribnif’s picture

Works for me. RTBC, IMHO.

jmcclelland’s picture

Works for me too. And I was able to apply it to the current (Aug 22, 2010) calendar dev version. Please include!

thanks,

jamie

SaxxIng’s picture

Status: Needs review » Reviewed & tested by the community

Same problem to me too. And patch suggest on #2 works very well. Please include on next release.
Thanks a lot,
Saxx

KarenS’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -link, -week column

Automatically closed -- issue fixed for 2 weeks with no activity.