summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--calendar.module7
2 files changed, 5 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 0ede6d8..f221539 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -10,6 +10,7 @@ The links at the top of the calendar page have been reworked into tabs. They wil
until you clear the caches. Use hook_calendar_links_alter() to alter the links or the titles
or to empty the links array if you don't want to see them.
+- Issue #1303458. Make sure calendar tabs work right without clean urls.
- Issue #1270538, Fix notice for missing index 'access'.
- Issue #1259870, Reinstate the test for a missing date argument for the pager and add to the message a warning that the problem could be that the default date is missing from the argument.
- Issue #1305938 by kristiaanvandeneynde and KarenS, Make sure the overlapping items work correctly with half hour grouping, and don't allow it for custom time groupings.
diff --git a/calendar.module b/calendar.module
index 340de8c..93d525a 100644
--- a/calendar.module
+++ b/calendar.module
@@ -104,19 +104,20 @@ function calendar_menu_local_tasks_alter(&$data, $router_item, $root_path) {
if (!empty($calendar_data['tabs'])) {
$delta = !empty($data['tabs'][0]['count']) ? $data['tabs'][0]['count'] - 1 : 0;
foreach ($calendar_data['tabs'] as $tab) {
- $item = menu_get_item($tab['path']);
+ $clean_path = str_replace('?q=', '', $tab['path']);
+ $item = menu_get_item($clean_path);
if (!empty($item)) {
$item['title'] = $tab['title'];
// If we have moved off the default page for the calendar, the
// links to the other views will have been adjusted to keep information
// about the right year/month/week/day to go to.
- $item['href'] = $tab['path'];
+ $item['href'] = $clean_path;
if (array_key_exists('access', $item) && $item['access']) {
$data['tabs'][0]['output'][$delta] = array(
'#theme' => 'menu_local_task',
'#link' => $item,
);
- if (strpos($tab['path'], $root_path) === 0) {
+ if (strpos($clean_path, $root_path) === 0) {
$data['tabs'][0]['output'][$delta]['#active'] = TRUE;
}
$delta++;