Home › Forums › Calendar Products › Events Calendar PRO › Notice: Undefined offset
- This topic has 14 replies, 2 voices, and was last updated 10 years, 12 months ago by
Brian.
-
AuthorPosts
-
April 16, 2015 at 1:17 pm #956130
Daniel Maier
ParticipantI’m receiving the following notice when using the week view on the calendar:
Notice: Undefined offset: 7 in \wp-content\plugins\events-calendar-pro\lib\template-classes\week.php on line 318
Any help is appreciated.
Thanks!
April 17, 2015 at 4:02 am #956214Brian
MemberHi,
Sorry for the issues here. That notice is showing because you have WordPress debug set to true:
https://codex.wordpress.org/Debugging_in_WordPress
It is a good idea on live sites to turn that off so notices like that do no show.
Set this to false in your wp-config.php: define(‘WP_DEBUG’, false);
Also, we are redoing the week view for 3.10 and that notice will be fixed in it so even if debug is on no notice will show.
Let me know if you have any follow up questions.
Thanks
April 17, 2015 at 7:18 am #956264Daniel Maier
ParticipantActually my WP_DEBUG is set to false:
define(‘WP_DEBUG’, false);
I did set to true and false to troubleshoot other errors but it is now set to false and the notice is still present.
Any other idea? Thank you!
April 17, 2015 at 11:18 am #956356Brian
MemberOh ok thanks for the info. My mistake I guess you have php set to show errors and notices…
So when I view the Week view I see the notice.
The strange thing is it starts with this: E:\Websites\cityofwinterpark.org
That looks like a local reference on a pc and not a server reference.
Do you have any custom templates in your theme in this folder /tribe-events/?
There maybe something in there causing it.
Let me know.
Thanks
April 17, 2015 at 12:10 pm #956375Daniel Maier
ParticipantThe E:\Websites\cityofwinterpark.org portion is because this server is a Windows server. I’m not sure why it shows the drive letter but that’s how it has been when reporting. That’s the true path for that site.
We do have /tribe-events/ but I’ve deleted it and tried again and the notice persists.
My PHP error_reporting is set to E_ALL & ~E_NOTICE & ~E_STRICT which should be the production value.
Thanks!
April 20, 2015 at 7:36 am #956676Brian
MemberOh Windows Server…
It is difficult for us to troubleshoot a Windows server.
I looked up and no one else has reported this issue and it looks like the only way to fix this would be to modify the plugin itself.
This change may fix the issue.
In this file:
\wp-content\plugins\events-calendar-pro\lib\template-classes\week.php on line 318
Change this:
// check for hash collision and setup bool for going to the next row if we can't fit it on this row
if ( ! empty( self::$events->all_day_map[ $hash_id ][ $all_day_offset ] ) || self::$events->all_day_map[ $hash_id ][ $all_day_offset ] == '0' ) {
$insert_current_row = true;
break;
} else {
$insert_current_row = false;
}To this:
if ( isset( $all_day_offset ) ) {
// check for hash collision and setup bool for going to the next row if we can't fit it on this row
if ( ! empty( self::$events->all_day_map[ $hash_id ][ $all_day_offset ] ) || self::$events->all_day_map[ $hash_id ][ $all_day_offset ] == '0' ) {
$insert_current_row = true;
break;
} else {
$insert_current_row = false;
}
}That may fix the issue, but without having a Windows Server I have no way to test.
In 3.10 we have rewritten the Week View so I am not sure if this bug would be in that version or not.
Let me know if this helps.
April 20, 2015 at 2:10 pm #956837Daniel Maier
ParticipantYeah, Windows Server, I know… Unfortunately that’s what I have to work on, sorry :/
Thanks for trying to help. However the change did not fix the issue. The same notice appears.
I removed the entire code and the error was gone. However, of course, the all day events were gone as well.
Any other tip? Thanks a lot!
April 20, 2015 at 2:11 pm #956838April 20, 2015 at 2:26 pm #956840Daniel Maier
ParticipantI also see another error that when hovering the all day events it triggers the following:
Uncaught TemplateError: ReferenceError: subTitle is not defined (on tribe_tmpl_tooltip line 3)
tribe_tmpl_tooltip line 21Then it doesn’t show the pop-up with the event details.
April 20, 2015 at 2:59 pm #956845Brian
MemberYou can try changing this :
if ( isset( $all_day_offset ) ) {to this :
if ( isset( self::$events->all_day_map[ $hash_id ][ $all_day_offset ] ) ) {And see if that helps.
Lets see about fixing this issue first before going into another issue as they could be related.
April 20, 2015 at 3:13 pm #956853Daniel Maier
ParticipantEXCELLENT!
That seem to have done the trick! However the pop-up for all day events is still triggering the following:
Uncaught TemplateError: ReferenceError: subTitle is not defined (on tribe_tmpl_tooltip line 3)
tribe_tmpl_tooltip line 21Thanks so much for working on this with me!
April 20, 2015 at 3:23 pm #956862Brian
MemberOk great, glad it is moving forward.
I noticed you are using jQuery 1.9.1
WordPress now ships with jQuery 1.11.1
Can you please use the latest version and see if that resolves this issue and also the issue when changing from month view and resetting back to today.
Thanks
April 20, 2015 at 3:27 pm #956865Daniel Maier
ParticipantI will need a little assistance with our programmer on this but I will check with him today and let you know what happens.
Thank you!
April 21, 2015 at 5:58 am #956993Daniel Maier
ParticipantHi Brian,
We have a custom \tooltip.php in \tribe-events\pro\week\tooltip.php
From your original:
<?php /** * * Please see single-event-hourly.php in this directory for detailed instructions on how to use and modify these templates. * */ ?> <script type="text/html" id="tribe_tmpl_tooltip"> <div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip"> <h4 class="entry-title summary">[[=title]]</h4> <div class="tribe-events-event-body"> <div class="duration"> <abbr class="tribe-events-abbr updated published dtstart">[[=startTime]] </abbr> [[ if(endTime.length) { ]] -<abbr class="tribe-events-abbr dtend"> [[=endTime]]</abbr> [[ } ]] </div> [[ if(imageTooltipSrc.length) { ]] <div class="tribe-events-event-thumb"> <img src="[[=imageTooltipSrc]]" alt="[[=title]]" /> </div> [[ } ]] [[ if(excerpt.length) { ]] <p class="entry-summary description">[[=raw excerpt]]</p> [[ } ]] <span class="tribe-events-arrow"></span> </div> </div> </script>We had the following:
<?php /** * * Please see single-event-hourly.php in this directory for detailed instructions on how to use and modify these templates. * */ ?> <script type="text/html" id="tribe_tmpl_tooltip"> <div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip"> <h4 class="entry-title summary">[[=title]]</h4> <strong>[[=raw subTitle]]</strong> <div class="tribe-events-event-body"> <div class="duration"> <abbr class="tribe-events-abbr updated published dtstart">[[=startTime]] </abbr> [[ if(endTime.length) { ]] -<abbr class="tribe-events-abbr dtend"> [[=endTime]]</abbr> [[ } ]] </div> [[ if(imageTooltipSrc.length) { ]] <div class="tribe-events-event-thumb"> <img src="[[=imageTooltipSrc]]" alt="[[=title]]" /> </div> [[ } ]] [[ if(excerpt.length) { ]] <p class="entry-summary description">[[=raw excerpt]]</p> [[ } ]] <span class="tribe-events-arrow"></span> </div> </div> </script>And our programmer tweaked to the following, which fixed the JavaScript warning:
<?php /** * * Please see single-event-hourly.php in this directory for detailed instructions on how to use and modify these templates. * */ ?> <script type="text/html" id="tribe_tmpl_tooltip"> <div id="tribe-events-tooltip-[[=eventId]]" class="tribe-events-tooltip"> <h4 class="entry-title summary">[[=title]]</h4> [[ if(typeof subTitle !== "undefined") { ]] <strong>[[=raw subTitle]]</strong> [[ } ]] <div class="tribe-events-event-body"> <div class="duration"> <abbr class="tribe-events-abbr updated published dtstart">[[=startTime]] </abbr> [[ if(endTime.length) { ]] -<abbr class="tribe-events-abbr dtend"> [[=endTime]]</abbr> [[ } ]] </div> [[ if(imageTooltipSrc.length) { ]] <div class="tribe-events-event-thumb"> <img src="[[=imageTooltipSrc]]" alt="[[=title]]" /> </div> [[ } ]] [[ if(excerpt.length) { ]] <p class="entry-summary description">[[=raw excerpt]]</p> [[ } ]] <span class="tribe-events-arrow"></span> </div> </div> </script>That seem to have fixed the problem and the pop-up for all day events is now showing up.
https://cityofwinterpark.org/events/week/2015-04-12
Please let me know if you have any comments.
Thank you for all your help!April 21, 2015 at 6:54 am #957007Brian
MemberI am glad to see you were able to fix this issue for both of these.
Since the issue is resolved I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘Notice: Undefined offset’ is closed to new replies.
