The calendar block does not advance to the next month when you click on on the arrow. The main calendar page does advance.

Comments

Mattanniah’s picture

Same problem. Both next and previous buttons link to the same page you're currently on.

metakel’s picture

same here.

Below is the links for both "previous" and "next" arrows (the current node nid is 8) on the Calendar Block. Both arrows have the same link, indicating that there is some problem. When clicking them, nothing change except the page reloads.

http://document_root/some_path?q=node/8

I think normally it should be something like (when current page is 2011-03):

http://document_root/some_path/calendar/2011-02
http://document_root/some_path/calendar/2011-04
metakel’s picture

Priority: Normal » Major

I have just tested the 7.x-1.x-dev released on 2011 February 25. This error also happens.

filsterjisah’s picture

subscribing

DaveMcLear’s picture

I have the same problem, would like to know how to fix this.

tbenice’s picture

OK, I get the prev link but no next link.

tbenice’s picture

I think that this might be an issue with the date_views module. In theme.inc where the navigation links are generated (template_preprocess_date_navigation(&$vars)), the conditional statement that generates the $next_url and $prev_url vars has this statement:

if (!empty($next_date) && !empty($vars['next_url']) && date_format($next_date, 'Y') > $view->date_info->limit[1]) {
$vars['next_url'] = '';
}
if (!empty($prev_date) && !empty($vars['prev_url']) && date_format($prev_date, 'Y') < $view->date_info->limit[0]) {
$vars['prev_url'] = '';
}

dsm of $view in that function shows no date_info->limit property. I'll look in the date module queue for this. Mean-time, I'm going to comment out this statement.

UPDATE: The issue is in the date queue fyi- http://drupal.org/node/1086574

Anticosti’s picture

Subscribing

vagrant’s picture

Version: 7.x-1.0-alpha3 » 7.x-2.x-dev

Same problem, month won't change in either direction

Modules installed:
Calendar 7.x-2.x-dev
Date: 7.x-2.x-dev
Views: 7.x-3.x-dev

kmoll’s picture

I had the same problem, so I dug through the api to figure out what the problem is, and I think I found it. In the theme.inc file the $vars['next_url'] and the $vars['prev_url'], call the date_real_url($view, Null, $next_arg), date_real_url($view, Null, $prev_arg), I looked up the api in the api.durpal.org, and it mentioned that date_real_url was in the date_api.module. After searching for it unsucessfully (date 7.x-2.x-dev) in that date_api module. I did find it in date_views.module. towards the bottom of that function (line 153), if it is the block view, its set to return a url function, and the query parameter was 'query' => drupal_get_query_parameters(Null, array($key =>$url)).

After looking up the drupal_get_query_parameters, the first argument should be the query and the second argument is $exclude, or things you want to exclude from the array keys, and that defaults to array('q'). So I got rid of the Null, and passed the array($key => $url) as the only parameter, and now it works.

Originally passing null, drfualts to the $_GET, so for me, it was always passing the argument of the page I was on, not the next or prev, month. After making the change the navigation is working for me.

I am new to git, I have my own repository with SVN, so I am going to read up on git, start checking out the projects from the drupal repository so I can provide a patch.

amysteen’s picture

I had the same issue, #10 fixed it for me too. Should this issue be moved to date module?

DaveMcLear’s picture

This worked for me also, brilliant work!...thanks :)

vagrant’s picture

#10 works for me as well, Thank you very much :)

lionheart8’s picture

Could you please post the code bit + corresponding lines for non-coders? ;)

kmoll’s picture

Yes, it starts in the date_view/date_views.module at line 150.

$key = date_block_identifier($view);
if (!empty($key)) {
return url($_GET['q'], array(
'query' => drupal_get_query_parameters(NULL, array($key => $url)),
'absolute' => TRUE));
}
}

should be:

$key = date_block_identifier($view);
if (!empty($key)) {
return url($_GET['q'], array(
'query' => drupal_get_query_parameters(array($key => $url)),
'absolute' => TRUE));
}
}

Anticosti’s picture

Thanks for the details kmoll :)
Followed #15 detailed intructions and still impossible to navigate on the minicalendar block
here's the type of link generated:
node?mini=calendar-date/2011-04

kmoll’s picture

Anticosti,

That looks like the correct link, the mini is the default calendar block and and 2011-04 is the month of April, have you checked the setting on your view to make sure that it takes a date argument?

lionheart8’s picture

Thanks kmoll, that seems to solve the problem. :)
I could move to different months in both directions, with no problem.

A question:
In case you are using the latest date + alpha ordev versions of calendar, could you be getting this error message with the calendar block enabled? [http://drupal.org/node/1102664]

Notice: Undefined index: group in _date_views_fields() (line 61 of /home2/woof/public_html/sites/default/modules/date/date_views/includes/date_views_fields.inc).

If not, what have you done to avoid it?

Regards

kmoll’s picture

I have not seen that error. I am using the current dev versions of both calendar and date. But if you open the file up, and you use the dsm function, if you have devel installed, you can print the object that that represents, and you can see if that property is missing, and if it is you can either figure out how to populate it, or figure out if the code needs a different property to function properly.

mkmaroon’s picture

Not sure if this is the correct place to put this, but I am technically having the problem that the calendar doesnt advance to to the next month. Pretty much none of the buttons (day, week, month, year, next month, previous month, an individual day or week) work. I know why it doesnt work I'm just not sure how to fix the problem.

I've embedded the calender page into a node like this:

<?php
print views_embed_view("calendar","calendar_1");
?>

I'm using the calendar 'Page' because I want all the features (links for day, week, month, year, next month, prev month, etc.)

So now this calendar rests on a URL like this: mysite.com/path-to-node
While the actual calendar is at: mysite.com/calendar
(note: the calendar works just fine on mysite.com/calendar)

The problem is, while on my node where I have embedded the calendar, all the links point to: mysite.com/path-to-node?=calendar/2011-03 (2011-03 is just an example).

I have figured out that if I modify my embed code above to accept parameters like this:

<?php
print views_embed_view("calendar","calendar_1", $_GET["a"]);
?>

then I can use URLs like this: mysite.com/path-to-node?a=2011-06 and it works! I'm just not sure how to configure my links to output like that (as opposed to mysite.com/path-to-node?=calendar/2011-03 ). Also I might be looking at this all wrong and there might be another or an easier way to accomplish my goals.

If I have posted this in the wrong place I apologize.

Any help would be greatly appreciated.

Thank you.

Anticosti’s picture

In Ref to #17:
Thanks kmoll!!! This is working now.

Cheers,

pazap47’s picture

Excellent kmoll # 15 works here as well.

KarenS’s picture

Status: Active » Fixed

The mini calendar navigation should now be fixed, but not in exactly the same way mentioned above.

vagrant’s picture

Updated TODAY to the latest dev versions on:
Calendar
Views
Ctools
Date

and flushed the cache (a few times)

This was to resolve the "no day event info" issue

The fix from #15 (Kmoll) worked fine before updating and now it does NOT work anymore. Additionally, my events on the calendar no longer show (I saw the other issue for this).

This is a fresh install of D7, not an upgrade.

Thanks

kmoll’s picture

What issue are you still having? One with the navigation of the calendar block, or an issue with day event info? I haven't looked at the latest release since it was put out.

vagrant’s picture

Hi Kmoll,
Actually both or more accurately all 3 issues:

1. Month doesn't move move with arrow buttons
2. Events no longer show on the calendar
3. Day view is inaccessible (see #2) but when I could see the page view it was still blank

#1 was undone by the update to the latest dev (prior your fix worked great)
#2 is a new issue after the update
#3 original issue that the update was made for. Not only didn't fix that issue but caused the breaks #1 & #2

Thanks again

kmoll’s picture

ok, like I said I haven't gotten a chance to look at the new update, hope to do so this weekend while I work on my project. My original fix, was just kind of a band-aid, not sure if it works in the scheme of how Karen structures the module. Hopefully I will get a chance to go through it and help her find a permanent solution

Status: Fixed » Closed (fixed)

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

vagrant’s picture

Sorry, but this situation stills exists.

Thanks

TelFiRE’s picture

I do not understand how people are finding #10 to solve their problem. No such file exists. There is no date_views.module file in calendar or any other addon that I can figure. There is no date_view folder. There is nothing of the sort.

kmoll’s picture

TelFiRE

I have been on a different project and have not been able to follow up on this problem since this thread initial began. At that point, that file did exist and there were some issues. I made a quick changed that seemed to solve the problem temporarily until a permanent problem could be implemented. I know this module has gone through many updates since then and solved many bugs that had popped up. Its possible that that section of code was integrated into another part of the module or taken out all together, I can't be too sure with out looking. Are you still experiencing this problem?

cabplan’s picture

Tried to follow #15 but cannot find this file indicated. My Next/Prev buttons do not work, it remains on the same month (nov) but the URL changes.

adamickes’s picture

For anyone still seeing this problem. Setting caching to none (under Advanced) in the calendar view fixed the issue for me.

Ajtis.pl’s picture

I have disbaled Block Cache in preformance tab.
And it helps :)