The following errors appear at the top of the calendar-date/week page:
Notice: Undefined index: groupby_times in template_preprocess_calendar_week() (line 477 of C:\mowes_portable\www\drupal\sites\all\modules\calendar\theme\theme.inc).
Notice: Undefined variable: divisor in template_preprocess_calendar_week() (line 490 of C:\mowes_portable\www\drupal\sites\all\modules\calendar\theme\theme.inc).
Warning: Division by zero in template_preprocess_calendar_week() (line 490 of C:\mowes_portable\www\drupal\sites\all\modules\calendar\theme\theme.inc).
Notice: Undefined variable: divisor in template_preprocess_calendar_week() (line 491 of C:\mowes_portable\www\drupal\sites\all\modules\calendar\theme\theme.inc).
Warning: Division by zero in template_preprocess_calendar_week() (line 491 of C:\mowes_portable\www\drupal\sites\all\modules\calendar\theme\theme.inc).
Calendar week view displays normally below these errors.
Errors disappear when there are no events in the week.
Calendar was working fine prior to updating to new 7.x-3.0-alpha2 version. Have now upgraded to 7.x-3.x-dev version, but errors still there.
Have also updated to latest -dev version of Date module.
Have followed these debugging steps: http://drupal.org/node/755312
Drupal version 7.9
Many thanks
Comment | File | Size | Author |
---|---|---|---|
#13 | calendar-week-groupby_times-1398584-13.patch | 815 bytes | dhalbert |
Comments
Comment #1
Korinvall CreditAttribution: Korinvall commentedSame errors with alpha 2 release + week view.
Comment #2
arlinsandbulte CreditAttribution: arlinsandbulte commentedtry the most recent -dev.
Comment #3
GinaF CreditAttribution: GinaF commentedI just updated to the most recent -dev for Date. I already have the -dev for Calendar.
Still getting errors.
I have also upgraded to Drupal 7.10
Comment #4
ewa777 CreditAttribution: ewa777 commentedHas anyone solved this yet? I am getting the same errors. It has been driving me crazy.
Comment #5
memoo CreditAttribution: memoo commentedsub
Comment #6
jpbturbo CreditAttribution: jpbturbo commentedI'm getting this error as well on a fresh install as of today.
If I have an all day event or an event with no specified end time(which then shows up as an all day event) it works fine with no errors.
Comment #7
jabraben CreditAttribution: jabraben commentedI am getting this exact error on the week view under the exact same conditions:
Calendar 7.x-3.x-dev
Date 7.x-2.0-rc1+69-dev
I got the error first when upgrading to:
Calendar 7.x-3.0-alpha2
Date 7.x-2.0-rc1
Then I moved to the dev version of both modules as I understood those were recommended at this time.
Comment #8
dhalbert CreditAttribution: dhalbert commentedI experimentally backed out changes via git, and I believe this is the commit that introduced the problem:
The error occurs when a date field during the week shown has an end date. If there is no end date for any event, no error is shown. In addition, even events without end dates are incorrectly shown in the all-day portion of the days. (EDIT: oops, #6 already noted this).
Comment #9
kristiaanvandeneyndeThe only notice to pay attention to here is the first one.
The other four notices are a direct consequence of the first.
Find out why the style option groupby_times is missing and this issue is resolved.
Comment #10
dhalbert CreditAttribution: dhalbert commentedFor convenience, here's the diff showing the changes.
There is some slightly odd code near the error. Notice how
$display_overlap
gets tested redundantly:Comment #11
dhalbert CreditAttribution: dhalbert commentedOK, this is apparently due to an uninitialized value in the Calendar View.
Here's how to fix an existing view:
Why there's an uninitialized value I don't know and needs further research, but the above should remove the error from an existing view.
Comment #12
jpbturbo CreditAttribution: jpbturbo commentedI was just able to fix it by editing the view for week view, then clicking on settings under FORMAT.
I made sure the group by was set to hour and then applied the new settings and now it works with no errors.
Now that it's working even if I go back in and set the group by to none it still displays without errors.
So maybe when the default calendar views are created the code that is supposed to set the default group by times isn't working.
Edit*
it looks like Dan posted a more detailed description while I was typing this out.
Comment #13
dhalbert CreditAttribution: dhalbert commentedHere is a one-line patch to fix the uninitialized value in the creation of the default view. Any existing views will have to be fixed by the steps in #11, though, I think.
This is my first patch and I'm not sure whether there are other things necessary to do to force the default view to be regenerated on a module update.
Comment #14
dhalbert CreditAttribution: dhalbert commentedto auto-test patch
Comment #15
kristiaanvandeneyndePatch seems pretty simple and okay to me to be honest.
(Not tested though)
Comment #16
thirdboxcar CreditAttribution: thirdboxcar commented#11 - dhalbert's solution worked perfectly for me. No patch needed. Thanks!
Comment #17
kristiaanvandeneyndeI do think a patch is needed to prevent others from getting this error in the future.
Comment #18
thekevinday CreditAttribution: thekevinday commentedThis problem actually exposed (or is exposed by) another problem, I suggest looking at: #1433046.
I created that issue as a separate issue because I think this one only addresses whether or not groupby_times is defined while that issue addresses a PHP coding problem.
Comment #19
KarenS CreditAttribution: KarenS commentedI'm committing this, but I'm working on a new view -- using templates instead of the default view. There will be a template for every date field that you can use to start a calendar and the default view will go away.
http://drupalcode.org/project/calendar.git/commit/4a29479
Comment #21
bszk CreditAttribution: bszk commentedI have just tried installing the latest dev of the calendar and it breaks my drupal 7
i.e. blank screen and the following message in the httpd error log:
PHP Fatal error: Call to undefined function date_views_base_tables() in /var/www/html/aps7/sites/all/modules/calendar/includes/calendar.views.inc on line 18
Do I need the dev version of views too?
Sorry I now realize that I needed to get the dev version od date which I have done but I still get these errors:
Notice: Undefined index: groupby_times in template_preprocess_calendar_week() (line 478 of .../modules/calendar/theme/theme.inc).
Notice: Undefined index: groupby_times in template_preprocess_calendar_week() (line 482 of .../modules/calendar/theme/theme.inc).
Comment #22
kristiaanvandeneyndeDid you read and try #11?
Comment #23
bszk CreditAttribution: bszk commentedOK
Now that I read it all more closely including #11 my problem is gone.
Sorry for this clutter.
Congratulations on the improvements in calendar/date etc.
It is quite nice now!
Bill
Comment #24
suntog CreditAttribution: suntog commentedThanks dhalbert,
I just did drush up to d7.12 and calender 7.x-3.0 and then used your solution on #11. Everything worked fine.
Comment #25
Dig1 CreditAttribution: Dig1 commentedI am currently running:
Drupal core 7.12, Calendar 7.x-3.0+7-dev (2012-Mar-25) etc.
I just encountered this same problem so I applied the fix in #11 and now everything works fine.
Thanks to Dan for identifying the problem...I was just about to start deleting views and then rebuilding them :o
Hopefully the fix will get committed soon.
Cheers
Comment #26
Morten Najbjerg CreditAttribution: Morten Najbjerg commentedIn my setup the groupby_times is not exported to the views code when using features. Anyone else experiencing this?
Comment #27
Morten Najbjerg CreditAttribution: Morten Najbjerg commentedTo clarify - the problem is not features. The groupby_times value is not exported through views export.
If I change the field to something else, it seems to be exported correct.
Perhaps this is just an error in my setup.
Comment #28
kip stanning CreditAttribution: kip stanning commentedgreat, @dhalbert! many thx for solution in #11. instantly solved my problem!
karl
Comment #29
gopherspidey CreditAttribution: gopherspidey commentedYes I am having the same export problem.
I can fix the proble with commit #11, but the export before 11 and after 11 are exactly the same. When exported directly from the views interface. (not even using features)
Comment #30
Navneet.Chauhan CreditAttribution: Navneet.Chauhan commentedYes!! it works for me but why is this type of issue ?
Comment #31
sonicthoughts CreditAttribution: sonicthoughts commented#11 worked for me.
Comment #32
francoud CreditAttribution: francoud commented#11 also worked for me.. and the problem was not only in the week view, but in the day view also. Both solved thanks.
Comment #33
calibba2 CreditAttribution: calibba2 commented#11 worked for me!!
Comment #34
delacosta456 CreditAttribution: delacosta456 commented#11 woks either for Week end Day in view
Comment #35
kingfisher64 CreditAttribution: kingfisher64 commentedIs #11 mentioned in the readme file? Might be worth putting some documentation to this if not.
Many thanks dhalbert for your solution.
Comment #36
eft CreditAttribution: eft commentedI have posted a summary of this problem that has been noted several times in the issue queue. I have also posted a patch. See #2160183: Undefined index: groupby_times
Comment #37
kingfisher64 CreditAttribution: kingfisher64 commentedThanks eft, not seen that post. It's only got 1 follower so I don't think others have either.
Comment #38
eft CreditAttribution: eft commented@kingfisher64 - If you can review the patch, that would be great.
Comment #39
wimarbueno CreditAttribution: wimarbueno commentedif it works :)
Why there's an uninitialized value I don't know and needs further research, but the above should remove the error from an existing view
Comment #40
doakym CreditAttribution: doakym commented#11 works for me!
Comment #41
IreOke CreditAttribution: IreOke commentedAwesome #11 works like a charm!!!
Comment #42
ewleamon CreditAttribution: ewleamon commented#11 Works for me too!
Comment #43
Jayjayel CreditAttribution: Jayjayel commented#11 works for me four
Comment #44
selva8187 CreditAttribution: selva8187 commentedThank you dhalbert,
#11 is perfect its work for me too.....
Comment #45
andreyna CreditAttribution: andreyna commented#11 Works for Day Display too!