Posted by dcasey on July 17, 2009 at 9:48pm
| Project: | Calendar |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | link, week column |
Issue Summary
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()?
Comments
#1
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
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 : ''));
}
#3
changing status to 'needs review'
#4
Works for me. RTBC, IMHO.
#5
Works for me too. And I was able to apply it to the current (Aug 22, 2010) calendar dev version. Please include!
thanks,
jamie
#6
Same problem to me too. And patch suggest on #2 works very well. Please include on next release.
Thanks a lot,
Saxx
#7
Committed. Thanks!
#8
Automatically closed -- issue fixed for 2 weeks with no activity.