I have a test machine and a live site and just noticed that there are no navigation menus at the top of the calendar to switch between the month, day, week views. I upgraded from the old calendar module and chose a default view and "reverted". What am I missing?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Status: Active » Fixed

Clear your caches, probably several times.

flightrisk’s picture

Not sure how many times to do it, but I've cleared the views cache and the main cache in Drupal 7.7 several times. I have the same issue on a localhost machine and on my live site. Here is the link: http://mckenziehoa.org/calendar-event/month I have added two displays to the "cal_event" view I cloned, so maybe I broke something? I keep getting messed up by having to remember to switch the dropdown in the views setting to apply to only this view and not globally.

KarenS’s picture

I don't know what to tell you, they work fine for me and apparently everyone else, since no one else is reporting this. The links are constructed automatically from every display on your view that has a path, so the other option is that you don't have anything with a path.

For things like this, if all else fails it is often far less work in the long run to just start over, using a clone of the default calendar view as a starting point. Make sure the default view has been reverted before you clone it or you may pick up crufty old stuff from older versions.

flightrisk’s picture

I was writing to tell you all that I did and it still was not working, but something fixed it in my localhost site. The last thing I did was disable the iCal module and re-enable it. It worked right after that. I have all the dev versions of calendar, ctools, date and views as of Aug 31 on that machine.

I noticed that when I click on the iCal display on the live machine, I get:

Parse error: syntax error, unexpected '!', expecting '(' in /home/mckenzie/public_html/sites/all/modules/calendar/calendar_ical/calendar-style-ical.tpl.php on line 13

Don't think it is a coincidence. I am going to upgrade all the modules now on the live machine and see what happens. The versions I had were all aug 8, aug 10 and aug 29

flightrisk’s picture

Title: My "month | week | day | year " navigation menus are gone from the calendar » My "month | week | day | year " navigation menus are gone from the calendar - FIXED

This was a strange one. The fix was to edit the view, go to the "Format" section for the "month" display. Open the Format and Show settings and just save them again to rewrite the values back to the database. Everything then works. I also updated to all the latest versions just in case.

graytoby’s picture

Priority: Normal » Major
Status: Fixed » Active

Reopening. I've encountered the same issue. Clearing caches doesn't do a thing. in addition I get this error:
Notice: Undefined index: access in calendar_menu_local_tasks_alter() (line 50 of /public_html/sites/all/modules/calendar/calendar.module).

graytoby’s picture

Title: My "month | week | day | year " navigation menus are gone from the calendar - FIXED » My "month | week | day | year " navigation menus are gone from the calendar
KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Try to edit the view and re-save it.

ellen.davis’s picture

I can report the same problem. I updated calendar/date/ctools/views on my site today.

Calendar 7.x-3.x-dev (2011-Aug-31)
Date 7.x-2.x-dev (2011-Aug-31)
Ctools 7.x-1.x-dev (2011-Aug-31)
Views 7.x-3.x-dev (2011-Sep-01)

And am not seeing this error: Undefined index: access in calendar_menu_local_tasks_alter() (line 50

The navigation menu items do not display.
Clearing caches does not help.
Editing the view and re-saving does not help.

I was also working on this yesterday on another site. I updated to the lastest -dev of all four modules there, and this error did not come up then.

chemicalroman’s picture

I have the same problem

Notice: Undefined index: access in calendar_menu_local_tasks_alter() (line 50 of /public_html/sites/all/modules/calendar/calendar.module).

Calendar, Views, Date and Ctools upgraded to lastest devs.

ellen.davis’s picture

I had other modules to upgrade. So, I went ahead and did them. I also ran cron. After I was finished, I looked at the calendar again. The navigation links are still missing. But the Undefined index: access error is gone. I did not do any updates to calendar.

I wouldn't think installing/updating other modules would have an affect on calendar. Would running cron?

graytoby’s picture

I've tried editing, flushing caches, running cron, flushing again, flushing just views caches, I've tried every possible combination to no avail.

zabelc’s picture

I'm seeing the same "Undefined index: access in calendar_menu_local_tasks_alter" error after updating to all the latest development releases, despite clearing my caches, and even restarting Apache.

CrashNet’s picture

I am seeing the same issue with the latest dev as well. Tried clearing the caches and reverting the view with no success.

ellen.davis’s picture

Ugh. The error is back today. I get the "Undefined index: access in calendar_menu_local_tasks_alter() (line 50" message three times.

Scyther’s picture

Also got this problem, using all latest dev versions.

Scyther’s picture

The Undefined index: access in calendar_menu_local_tasks_alter seems to come from that the $item is NULL because of a incorrect value for $tab['path'], generated by this issue #1268780: $part_path in calendar_preprocess_date_views_pager() seems to be incorrect when base_path() is '/'.

wusel’s picture

@KarenS:

What do you meen with #3: "Make sure the default view has been reverted"?
How to do this on a existing Drupal-installation?

Thank you very much!

Geex2011’s picture

also getting this error but 4 times after updating my calendar from the alpha version to the dev version!!!!

Notice: Undefined index: access in calendar_menu_local_tasks_alter() (line 50 of C:\wamp\www\rms1\sites\all\modules\calendar\calendar.module).
Notice: Undefined index: access in calendar_menu_local_tasks_alter() (line 50 of C:\wamp\www\rms1\sites\all\modules\calendar\calendar.module).
Notice: Undefined index: access in calendar_menu_local_tasks_alter() (line 50 of C:\wamp\www\rms1\sites\all\modules\calendar\calendar.module).
Notice: Undefined index: access in calendar_menu_local_tasks_alter() (line 50 of C:\wamp\www\rms1\sites\all\modules\calendar\calendar.module).

If this issue is related to the local actions included on the calendar, how can I disable the local action since i really don't need them???

PS: Despite the issues.... I want to say "THANK YOU - YOU ROCK" for all maintainers for this module and the date module

Thanks,
Hashim

mErilainen’s picture

No navigation here either, after updating to the latest dev-version.

Geex2011’s picture

I did some testing and found that the Calendar 7.x-3.x-dev (2011-Aug-24) version works fine but I am having new issues with customizing the date field settings which i don't know if they are related or not to this version...

Thanks,
Hashim

ccurwen’s picture

subscribe. I didn't realize the nav menu had gone until suddenly it appeared. Now, sadly it is gone again. Hoping to get to the bottom of this soon. Thanks for the great module though!

drewkeller’s picture

Status: Postponed (maintainer needs more info) » Active

Seems like the OP is not the only one reporting this any more... also not sure what more information to provide.

Took me a while to figure out how to revert the view. You have to enable the Date Tools module. Then the dropdown in the view will have an option to revert the view.

1. So I reverted the 'Calendar' view and removed the clones I had before.
2. I 'Flushed all caches' FIVE times (hopefully that is considered enough... if not, please indicated how many times is enough).
3. Emptied all cache tables from the drupal database in phpmyadmin
4. Accessed the /calendar/month url.
5. The month page DOES NOT have the links.

At the end of the calendar_preprocess_date_views_pager() function, I added 'dvr($calendar_links)' which outputs

array(
  'calendar/month' => array(
    'tabs' => array(
      'month' => array(
        'title' => 'Month',
        'path' => 'calendarmonth2011-09',
      ),
      'week' => array(
        'title' => 'Week',
        'path' => 'calendarweek2011-W36',
      ),
      'day' => array(
        'title' => 'Day',
        'path' => 'calendarday2011-09-01',
      ),
      'year' => array(
        'title' => 'Year',
        'path' => 'calendaryear2011',
      ),
    ),
    'types' => array(
      'month',
      'week',
      'day',
      'year',
    ),
  ),
)

So the links are being processed... but they are not getting added to the output. From a comment in the code, apparently there are some tabs that are supposed to be created? I looked in the calendar-month.tpl.php template and the template_preprocess functions, but I don't see anything in them about the calendar_links. I tried setting my drupal theme back to the default theme in case something was weird in the theme, but I still don't see any links or tabs. At this point, it's beyond my drupal knowledge where they might be hiding.

Scyther’s picture

@drewkeller is your base_path '/' ?

I have same output as you. This issue is about this http://drupal.org/node/1268780

drewkeller’s picture

@scyther: Yes, fixing the urls seems to fix it and allow the tabs to appear.

Patch attached.

Scyther’s picture

Please read this http://drupal.org/patch/submit to submit a patch to a issue properly, so you know how next time.

arlinsandbulte’s picture

Status: Active » Closed (duplicate)
ccollins61’s picture

The issue is most likely, as it was in my case, a theme refresh issue. Go to Advanced Settings, Theme: Information from any of the calendar views and do a "Rescan Template Files." That should fix it.

mErilainen’s picture

I'm also still experiencing this error, although the navigation was working before updating again to latest dev.
I have cleared caches and run cron, reverted and saved the original view and also rescanned template files several times.

No errors are thrown to apache log, only notices in watchdog:

Notice: Undefined index: #title in calendar_plugin_style->options_form() (line 51 of /Users/myusername/Sites/sitename/sites/all/modules/contrib/calendar/includes/calendar_plugin_style.inc).

Notice: Undefined variable: calendar_type in calendar_plugin_style->options_form() (line 87 of /Users/myusername/Sites/sitename/sites/all/modules/contrib/calendar/includes/calendar_plugin_style.inc).

Notice: Undefined variable: calendar_type in calendar_plugin_style->options_form() (line 95 of /Users/myusername/Sites/sitename/sites/all/modules/contrib/calendar/includes/calendar_plugin_style.inc).
mErilainen’s picture

Here is the patch from comment 25 in, hopefully, proper format. Works for me.

EDIT: Ups, I didn't notice this is already waiting to be committed in the other thread.

trigdog’s picture

I am also having this issue with the latest dev (Sept 17). Did this patch get committed?

middlenewman’s picture

Status: Closed (duplicate) » Active

Also having this issue. Running the latest dev version... Have tried all suggestions with no luck...

Scyther’s picture

middlenewman’s picture

I don't think that is relevant to my issue. Does that fix the fact that this latest dev version removes the sort options of "Month Week Day Year"?
And I know for a fact that it is this latest version, because luckily I found my backed up version and my events are placed on the correct day now (that's another issue I posted, all the events were posting on the first day of the month, week, etc.) and I have the sort by links.
I don't know... I am going to suggest everyone roll back if they can until another dev fixes these issues.
I had all the view settings the same on both version of the 7.x-3.x- devs and the latest one fails on so many levels.

Scyther’s picture

Status: Active » Closed (duplicate)

This issue is about My "month | week | day | year " navigation menus are gone from the calendar not other issues that you seems to have what I can understand from your comment.

And this issue is caused by the issue here http://drupal.org/node/1268780 so your issues is not relevant to this.

middlenewman’s picture

Status: Closed (duplicate) » Needs work

No sorry, I was having this issue as well.

Scyther’s picture

Status: Needs work » Closed (duplicate)

Still duplicate of this http://drupal.org/node/1268780 as maintainer arlinsandbulte wrote in #27

kristiaanvandeneynde’s picture

Status: Active » Closed (duplicate)

Last commit in assumed 'duplicate' did not fix the issue.

For instance, I have the following variables:

$href: 'http://localhost/prof/calendar/month/2011-09'
base_path(): '/prof/'

Which would lead to a $parth_path of '/localhost/prof/calendar/month/2011-09' using
$part_path = substr($href,strlen(base_path()));

This is not a duplicate issue, seeing as the other issue is specifically about a base_path() being '/'.
The issue here is obviously that there should not be a 'http://localhost' in the $href.

If you look at the called date_pager_url() function in date/date_views/date_views.module, you'll find the following at the bottom:

  // Normal views may need querystrings appended to them
  // if they use exposed filters.
  return url($view->get_url($args), array(
    'query' => date_views_querystring($view), 
    'absolute' => TRUE));

Change it to:

  // Normal views may need querystrings appended to them
  // if they use exposed filters.
  return url($view->get_url($args), array(
    'query' => date_views_querystring($view), 
    'absolute' => FALSE));

And the tabs will work.
However, this breaks features such as day number links in the Month view.

Therefore, I suggest you change the way $href is built.

kristiaanvandeneynde’s picture

Status: Closed (duplicate) » Active

Reopening, see post above.

Addendum:
calendar/theme/theme.inc calls
date_pager_url($view, $type, NULL, TRUE, FALSE);

While the function signature in date/date_views/date_views.module is:
function date_pager_url($view, $date_type = NULL, $date_arg = NULL, $force_view_url = FALSE) {

Four parameters specified, five supplied...

rv0’s picture

Status: Closed (duplicate) » Active

subscribe

as reported in #38, latest dev does not fix issue.

kristiaanvandeneynde’s picture

Status: Active » Needs review
FileSize
1.27 KB

Seeing as there has been no maintainer answer for a week, I'm supplying a patch of my own.
It seems to work just fine for me, although a third party review would be nice.

For reference, the patch changes lines 45 and 46 in calendar/theme/theme.inc to:

      $href = parse_url(str_replace($current_path, $path, date_pager_url($view, $type, NULL, TRUE, FALSE)));
      $part_path = substr($href['path'],strlen(base_path()));
flightrisk’s picture

Hi Karen,

You've disappeared. Busy, Vacation? It looks like while you've been away, a generous contributor has fixed the disappearing view links issue and the issue where clicking the links takes you to the wrong dates and you have to keep manually selecting them again. You mentioned weeks ago changing the links to tabs, have you done anything with that? Thanks.

Fred

presleyd’s picture

Hmmm when applied against the latest dev version this patch doesn't seem to do anything for me. The tabs still don't appear after reverting the view and clearing the cache.

edit: Hmm it is working now after a ctools update I had missed.
edit2: The tabs now appear for me with or without this patch.

kristiaanvandeneynde’s picture

@presleyd:
The tabs apparently already worked if your base_path() was '/'.
The patch above fixes it for all other SEO friendly paths.

Tobion’s picture

The links to the different views do not appear for me too.
I have all the latest dev-versions and cleared the cache and tried patch #41.
Nothing works.
I also have another issue: The "prev" and "next" text is missing for the "year"-view. And the clear pager format option does not work. But only for the year view...
See http://www.kwobadminton.de/kalender/jahr

rwilson0429’s picture

subscribing

TechNikh’s picture

I have same issue. I manually made these changes but didn't work

//$href = str_replace($current_path, $path, date_pager_url($view, $type, NULL, TRUE));
$href = parse_url(str_replace($current_path, $path, date_pager_url($view, $type, NULL, TRUE, FALSE)));
$part_path = substr($href['path'],strlen(base_path()));
// Once we have a path for the links to other displays, add it to our links array.
//$calendar_links['calendar calendar-'. $type] = array('title' => $title, 'href' => $href);
$calendar_links[$current_path]['tabs'][$type] = array('title' => $title, 'path' => $part_path);

Chaos tools 7.x-1.0-rc1
Date 7.x-2.0-alpha4
Calendar 7.x-3.0-alpha1
Views 7.x-3.0-rc1

flightrisk’s picture

So two months and counting now without a word from a maintainer unless I missed it. This has become "The Drupal Way". For anyone who has seen this working, Did Karen add these as tabs, or are they still just hyperlinks to the different views?

kkuhnen’s picture

subscribe

peteruithoven’s picture

Subscribe

flightrisk’s picture

It is incredibly frustrating to wait months and have no reply from a maintainer. We realize people have other projects and busy lives and mostly volunteer, but can't Karen or someone at least answer this thread? Thanks.

kristiaanvandeneynde’s picture

Priority: Major » Critical
KarenS’s picture

They are tabs. If you are not seeing them see if they work in a core theme (maybe it is a theme problem).

I have been spending several hours a day working my issue queues, including nights, weekends, and holidays, and still can't get to everything fast enough to keep people from yelling at me.

I'm trying to get a stable release of Date out the door. Calendar is dependent on that. If I stop and fix Calendar issues Date won't get a release. Calendar is next after that.

flightrisk’s picture

Dear Karen, It was more pleading, not yelling ;) But sorry for that. I wish I knew the code to your level so I could help. Thanks for all your hard work.

jmoughon’s picture

Hey I wanted to post how I got around this. I have not really been following the conversation, but I just got it working in a cloned view.

I am using current Dev of Calendar and Date as of this post.

All I did was go to Calendar Settings in each view (Year, Month, Week, & Day) and update the setting to be the corresponding time segment. Update Month even if it displays correctly.

The Links then displayed on my cloned cal view.

KarenS’s picture

Status: Needs review » Fixed

This was harder than heck to figure out because I couldn't replicate it. I finally was able to replicate it and it turns out to be a problem getting calendar_preprocess_date_views_pager() to be recognized. That function is in a separate file that apparently is not always available. If it is not available when the theme registry is built, the function never gets called. I moved the function into the main calendar.module file to be sure it can always be discovered.

To get this working again you need to pick up my code with the fix (which won't show up in the tarball until perhaps tomorrow), then clear the caches to get the theme registry to rebuild itself.

The commit is: http://drupalcode.org/project/calendar.git/commit/f28124d

Note that I did NOT use any of the patches in this issue.

Status: Fixed » Closed (fixed)

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

Brandon_ST’s picture

@flightrisk thanks! This one worked for me (#5)! Was driving me nuts.

mjk3r’s picture

It's clearly not working for me - I have no "Month", "Week", "Day" tabs.

Using:
Drupal Core: 7.22
Date: 7.x-2.6
Calendar: 7.x-3.4
Theme: subtheme of Omega 3

Spent countless hours reading posts and trying to follow each and every possible hint. All have failed.

What I have tried:
- yes - tabs are not there for base themes as well (Bartik)
- opening and saving Calendar settings (suggested by #5 and others)
- rescanning theme (Advanced-> Theme suggested by #28)
- deleting calendar view and rebuilding it again
- none of the patches above are not applicable - to what I understand, the code has been changed since
- always flushing several times

any help - anything at all - would be greatly appreciated
thanks

zkrebs’s picture

Same as #60, can't get tabs to show. Please help.

wusel’s picture

@ #60 and #61:

My tip:
Delete your calendar and create the new like Step 1 No. 4. from https://drupal.org/node/1477602 (Cookbook: Prepare an Event-Calendar for Drupal 7).

Good luck!

Wusel

akalata’s picture

Another thing to remember (I'm writing this for me as much as anyone else, because this is the 2nd or 3rd time I've forgotten): If you want to change the path of the view (from /calendar-node-field-date to something like /calendar), you MUST KEEP the month/day/week/year after it. You'll be able to link to just /calendar with the month as default, but without month specified in the path (so the full path of the month display is /calendar/month) the tabs will not show up.

mjk3r’s picture

To: wusel (#62)
Sorry - it just doesn't help. I have done it several times with no success....

mjk3r’s picture

To: akalata (#63)

Tried this :
1. changed the paths to include "../month" and "../week"
2. Cleared caches (twice)
3. No change - "month" and "week" navigation links are not there

arancedisicilia’s picture

Hi everybody.

After a painful hour struggling, I found the answer here: http://success.grownupgeek.com/index.php/2010/07/25/how-add-tab-views/

The (good) article deals with views tabs in general, and it applies for calendar too.
Very easy, the solution is just that all the tabs you want to add MUST share the same base path. It worked immediately wor me!

zkrebs’s picture

Can confirm #66 works, thanks. I had to make the path for the default month tab /calendar/month for it to work.

Lumis’s picture

Confirm #66
One has to set the each path for the Calendar view's display Month, Week, Day, Year in this way:

/<whatever>/month
/<whatever>/week
/<whatever>/day
/<whatever>/year

The tabs show then perfectly

SeanA’s picture

Issue summary: View changes
Priority: Critical » Major
Status: Closed (fixed) » Active

No tabs on calendar pages, and none of the fixes here work. Incredibly frustrating.

EDIT: On my custom calendar view, nothing gets the tabs to appear. Just for fun, I created a new calendar view and simply saved it without making any changes. The tabs do appear on this one.

SeanA’s picture

Status: Active » Closed (fixed)

I was able to customize the newly created view and the tabs are still working. No idea why they disappeared on the original view and refused to come back. The solution in certain instances where this occurs seems to be to delete the view and make a new one.

BeWhy’s picture

Just in case anyone goes hunting for this like I did.

I had admin_menu installed and set the tabs to show up in the menu bar. So the tabs were 'missing' when I went to the page as a logged in user with menu access, but they worked when logged out.

merrizervas’s picture

None of these patches worked for me, I'd suggest just remaking the view as well