A calendar as a page, tells me:

Notice: Undefined index: style_plugin in calendar_preprocess_date_views_pager() (line 27 from ...\sites\all\modules\calendar\theme\theme.inc).

I'm using:
Drupal core 7.7
Zen 7.x-5.x-dev (2011-Jul-06)
Interactive Media 7.x-3.0
an own subsubtheme (changing colors, sizes, ...)

Calendar 7.x-3.x-dev (2011-Jul-31)
Chaos tool suite (ctools) 7.x-1.x-dev (2011-Jul-29)
Date 7.x-2.x-dev (2011-Jul-31)
jQuery Update 7.x-2.x-dev (2011-Apr-13)
Views 7.x-3.0-rc1

Please help me.
Thanks in advance

CommentFileSizeAuthor
#4 calendar-errors.txt8.56 KBCrell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Give me some clue what steps you followed. Did you start out with a view created in Calendar 7.2 and swap in the 7.3 code without making changes to the view? Are you using the default calendar view? What exactly have you done and what is in the view you are using?

Todd Young’s picture

Status: Postponed (maintainer needs more info) » Active

I am getting a very similar error with the latest version of everything, including my 'Mayo' theme:

Notice: Undefined index: style_plugin in calendar_granularity_path() (line 197 of /_rwk-dev/webroot/frantown_dev/sites/all/modules/calendar/calendar.module).

I am creating a calendar view from scratch, showing only titles from only one node type. The error shows 94 times whenever I try to show the calendar. It's not just as a page, it even happens while I'm still editing the view and haven't saved it yet.

Todd Young’s picture

@wusel I managed to get by this by deleting all my own calendars, REVERTING the included calendar and then making all new calendars a clone of the default, included one.

Crell’s picture

FileSize
8.56 KB

I get the same. I'm using the 3.x-dev release of Calendar. Newly created from-scratch view. The result is the calendar displays, but shows no data. Another display on the same view that just uses a table works fine, so I know the filters are correct.

I'm attaching an export of my view. The error happens with the Master display as well as the Content Pane, but not with the Page as it's using a non-calendar style plugin. I'm trying to filter/show by a Date field on Episode nodes.

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

I committed a fix last night for the master display in the default view. I'm not sure how to reproduce the other errors. With last night's fix and latest dev versions of everything else (Date, Views, and CTools) everything works fine for me. I did have to clear caches multiple times and merlinofchaos suggested a registry clear may have had to happen before the errors went away.

anis.khan’s picture

I am also getting this error.

Using:
Calendar 7.x-3.x-dev (2011-Jul-31)
Chaos tool suite (ctools) 7.x-1.x-dev (2011-Jul-29)
Date 7.x-2.x-dev (2011-Jul-31)
Views 7.x-3.x-dev

I uninstalled my Calendar 7.x-2.0-alpha1 and deleted the default view associated with it. Installed Calendar 7.x-3.x-dev, followed instructions at 'D7.3 Calendar installation & configuration screencast from Arlin Sandbulte'.

The only change I made to the instructions as shown was deleting the block included in the default view and creating a new one. (I accidentally deleted the existing contextual filter, so I built a new block.)

anis.khan’s picture

Quick follow-up. I was able to resolve this issue by clearing my caches, reseting and reconfiguring the default calendar view (without deleting any existing components). Also, I took care to ensure the contextual filter for the 'Upcoming' section applied only to that page. For some reason, the default on this page was set to overide all displays with "day" granularity. The issue may be that I accidentally overode all displays, but I suspect that deleting the canned contextual filter and trying to create another through the UI might be the culprit.

Crell’s picture

If it's still not possible to build a calendar from scratch rather than cloning the base view, then 3.x is not really an improvement on 2.x. It looks like it's possible now, but everyone seems to be starting from the stock one still. Folks, can you try setting up a new view from scratch?

KarenS’s picture

@Crell it *is* possible to build it from scratch, but there are a lot of steps, I don't know why anyone would want to try. Please don't dismiss the 7.3 code (saying it's not an improvement unless you can build a calendar from scratch), it was a massive effort that cut out 90% of the code and fixed a ton of bugs and tooks hours and hours hours to do.

KarenS’s picture

I haven't yet written the instructions for building a calendar from scratch. It's different than it was in the older code. Each display is a regular page, with its own url. It needs a contextual filter set to the right granularity for the display. It needs the new date pager, which will use the date argument to add the back/next links and control the query. It needs a calendar style, which in turn needs the new calendar row plugin. If you use some other row plugin with the calendar style it isn't going to work. I haven't figured out how to prevent you from trying that tho. There currently is a row plugin for the node table. Once I am done tweaking that, I will create row plugins for other tables. I did a presentation at DrupalCamp Wisconsin about how this all works and will be trying to get other information out, but can't until I can get these issues resolved so I can cut a release.

If you use the default calendar view on a new installation using the latest dev versions of Date and Calendar you should have no trouble. You can also create a date field and related calendar using the Date Wizard, and I want to add a Calendar wizard that will build a calendar for an existing date field. But if you understand what components are needed you can build it from scratch.

KarenS’s picture

Oh, and the iCal feed is different too, it is also now a row plugin. You control what is displayed in the body of the iCal feed by what you set up for the 'iCal' view on the Display Fields screen, in the same way you set up an RSS feed view.

KarenS’s picture

@Crell, looking at your export, you have a date argument but you don't have a date default value, you are doing a summary view. The pager and calendar examples all use an argument with a specified granularity that has a date default value. So you're trying to do something totally different than what I do in the calendar. Now that you can build a calendar from scratch I guess I have to try every possible combination of all the date components that people might try to put together to see what various unexpected combinations will create and try to prevent combinations that won't work. But I don't have time to do that now. The default calendar *does* work. I can't promise that anything else you might try will work yet.

wusel’s picture

@KarenS
yes, it is possible to build a calendar from scratch. The main point is to set an correct "contextual filter". This has to be the date of the displayed event.
Is it possible for you to chance the code of ths module, to show the block "Calendar Legend" only, if a calendar with colours is visible in another block?

Thank you for this very beautifully module.

@Crell:
Tip: Have a look at the new screencasts for "calendar and Drupal7".

Oleksandr.Masovets’s picture

@KarenS
Hi, i have found out why the topic error appears. I saw the notice in the calendar.module
198 @TODO Why is this sometimes empty for a style that uses the default value?
and answer is - because the views display with format Unformated list does not have style plugin in a view object at all.
And if in your whole view you have a view display with format Unformated list you will get this error.

So, may be it is a good reason to check if isset($display->display_options['style_plugin']) in the calender_granularity_path function.

KellyB’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Upgraded existing site from 7.x2 dev as my titles are changed the order of the words -eg -event title 'Are we there yet?' displays as 'There yet are'.

When I go in to edit the view I can not.
Notice: Trying to get property of non-object in views_ui_get_display_tab().
Display "Defaults" has an invalid style plugin.

During the upgrade I did not delete the old view.
I have flushed the caches multiple times.
Core: 7.7
Chaos Tools: 7.x-1.0-rc1
Calendar 7.x-3.0-alpha1
Date 7.x-2.0 alpha3
Views: 7.x-3.0-rc1

Am stalled and not sure what to try next. thanks in advance for any help.

KarenS’s picture

@KellyB, this is a report about and error "Undefined index: style_plugin", you are getting a totally different error and this muddys the waters for this issue. You are also using outdated code, get the latest versions of both Date and Calendar.

KarenS’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I have tried every which way I can to reproduce anything like this error in the 7.3 version and cannot. If someone can find a way to produce the original error in 7.3 I need steps to reproduce.

dru paul’s picture

I get this error after I did the update from 7.3 dev to 7.3 alpha. It was working fine until then. Lost the week day year links and got many error messages. Uninstalled alpha and reinstalled dev but still getting the one error and no luck getting the functionality back.

arlinsandbulte’s picture

You might need to (revert &) rebuild your calendar view.

Note:
Dev is ALWAYS more current than any other packaged release (stable, alpha, beta, etc.). When you went from 7.x dev to 7.3 alpha, you most likely installed an older version. Of course, that depends on when you downloaded the dev version.

scottiedude’s picture

Category: bug » task
Status: Closed (cannot reproduce) » Needs work

So I reverted to the previous calendar and I got it working, however, I've lost all styling related to the calendar before. Can it be revived? I do have backup's etc... however I don't know where the new css is... I've tried replacing, and nothing prevails.

arlinsandbulte’s picture

Category: task » bug
Status: Needs work » Closed (cannot reproduce)

@scottiedude: The original issue is resolved by using the latest dev code & reverting your calendar view.

As for the second part of your issue (which is NOT the original issue): what version of calendar did you update from (what was 'the calendar before')?
Anything before calendar 7.x-3.x will need to be completely re-styled as 7.x-3.x is a almost a complete rewrite. In that case, no, I don't think there is any easy way to revive your previous styling.

Dig1’s picture

Status: Closed (cannot reproduce) » Active

I can replicate this error message...but it may not relate specifically to Calendar module...:

I install:
Drupal core 7.7 and use Bartik
Administration menu 7.x-3.0-rc1
calendar 7.x-3.x-dev (2011-Aug-29)
Chaos tool suite (ctools) 7.x-1.x-dev (2011-Aug-07)
date 7.x-2.x-dev (2011-Aug-29)
Views 7.x-3.x-dev (2011-Aug-30)

I enable:
Ctools: CTools, Page manager, Views content panes
Calendar: calendar,
Date: date, date API, date views
Views: views, views_ui

I access: Home » Administration » Structure » Views
then Add Content Pane
then Save

and voila! Notice: Undefined index: style_plugin in calendar_preprocess_date_views_pager() (line 27 of .../sites/all/modules/calendar/theme/theme.inc).

When I delete Content Pane the error message goes away...

Thanks lots for re-writing this module because it really helps improve the user experience.

I hope you can replicate this error message.

Cheers

Dig1’s picture

FYI a search on Google shows that:

1) http://envisionize.com/calendar/day/2011-08-29 appears to be having the same problem
2) http://www.leveltendesign.com/solution/drupal-errors-notice-undefined-in... suggests that 'the particular above notice is created when php tries to access a index of an array where the variable is not holding an array.' They suggest that the error message can be suppressed by turning off php reporting notices...

I'll see what happens...

zabelc’s picture

I'm seeing this as well in the latest of all modules. It appeared to crop up when I tweaked the Calendar display settings for the month view and specified that it should apply to all views.

  • Notice: Undefined index: style_plugin in calendar_granularity_path() (line 197 of /home/patcms/public_html/sites/all/modules/calendar/calendar.module).
Dig1’s picture

Status: Active » Closed (fixed)

Good News!

I have just updated to:
Drupal core 7.8 and use Bartik
Administration menu 7.x-3.0-rc1
calendar 7.x-3.x-dev (2011-Sep-01)
Chaos tool suite (ctools) 7.x-1.x-dev (2011-Sep-01)
date 7.x-2.x-dev (2011-Aug-31)
Views 7.x-3.x-dev (2011-Sep-01)

And Notice: Undefined index: style_plugin in calendar_preprocess_date_views_pager() (line 27 of .../sites/all/modules/calendar/theme/theme.inc) NO LONGER APPEARS when I create a content pane as per #23.

Thanks to all the developers for this...I shall mark it as Closed (Fixed). :)

ruess’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I've updated to all the listed modules (or higher) but started noticing the same issue. One things that seemed to correct the issue withough recreating the entire view was something related to the View's Format area settings which include "Format" and "Show." I believe the error appeared after I added a new sub-view and accidentally changed the "format:" setting from calendar to html list but rather than specifying it for just this page, I chose to override all. To resolve it, I had to ensure that each sub-view used it's own format settings rather than inherit the master.

Not a fix, just an observation -not sure what it's hinting at or if anyone else can replicate it however.

Elyoukey’s picture

I had this problem and found a turnaround that may be interesting for other having the same.

-i did export the custom view i created
-i added in the php code generated

$handler->display->display_options['style_plugin'] = FALSE;
in the part concerning the display (i had only 1 display but i guess you should add it in all displays of your view.)

-i imported the new view
-i fixed back not working stuff (format was not calendar anymore)

and now it works

hope it helps

d.novikov’s picture

Go to admin/structure/views/settings, enable "Always show the master display". Usually master display uses "Unformatted list" style, "Fields" format, and "Display a specified number of items" pager. If these settings have been overriden by Calendar, you get a notice. For me it helped just to restore these settings to the default state.

jide’s picture

I had the issue too, but after upgrading to the latest dev, it went away.