diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2206b9e15fe19b1d995d8d60982c8d3fba9972c0..5aff2bcf93540356627dfc676e7bd7c628e812cb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Calendar Module 7.x Version 7.x-3.x-dev =================== +- Issue #1399964, Make sure calendar paths all take into account arguments ahead of the calendar arguments when creating links. - Issue #1253482, Get rid of attempt to keep track of current location when switching between calendar views, each one will go back to default. - Issue #1415326 by bkline, Fix help link. - Issue #1436020 by scrypt, Missing space in attributes at Month's day cell. diff --git a/calendar.module b/calendar.module index f807925bce45aadeeffff76b58e3d196a5822304..62f72c07c6a4e757c958a71bd17a6c4278029af5 100644 --- a/calendar.module +++ b/calendar.module @@ -38,9 +38,10 @@ function calendar_preprocess_date_views_pager(&$vars) { continue; } if ($display->display_options['style_plugin'] == 'calendar_style' && !empty($display->display_options['path'])) { - $path = $display->display_options['path']; + //$path = $display->display_options['path']; $title = $display->display_title; $type = !empty($display->display_options['style_options']['calendar_type']) ? $display->display_options['style_options']['calendar_type'] : ''; + $path = calendar_granularity_path($view, $type); $calendar_links[$current_path]['tabs'][$type] = array('title' => $title, 'path' => $path); $calendar_links[$current_path]['types'][] = $type; } @@ -384,7 +385,19 @@ function calendar_granularity_path(&$view, $granularity) { if ($display->display_options['style_plugin'] == 'calendar_style' && !empty($display->display_options['path'])) { $type = !empty($display->display_options['style_options']['calendar_type']) ? $display->display_options['style_options']['calendar_type'] : 'month'; if ($type == $granularity) { - $paths[$view->name][$granularity] = $display->display_options['path']; + $part_path = $display->display_options['path']; + $parts = explode('/', $part_path); + if (in_array('%', $parts)) { + $current_path = parse_url($_GET['q']); + $current_parts = explode('/', $current_path['path']); + foreach ($parts as $key => $part) { + if ($part == '%') { + $parts[$key] = $current_parts[$key]; + } + } + $part_path = implode('/', $parts); + } + $paths[$view->name][$granularity] = $part_path; } } }