Notice: Undefined offset

Home Forums Calendar Products Events Calendar PRO Notice: Undefined offset

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #956130
    Daniel Maier
    Participant

    I’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!

    #956214
    Brian
    Member

    Hi,

    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

    #956264
    Daniel Maier
    Participant

    Actually 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!

    #956356
    Brian
    Member

    Oh 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

    #956375
    Daniel Maier
    Participant

    The 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!

    #956676
    Brian
    Member

    Oh 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.

    #956837
    Daniel Maier
    Participant

    Yeah, 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!

    #956838
    Daniel Maier
    Participant
    #956840
    Daniel Maier
    Participant

    I 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 21

    Then it doesn’t show the pop-up with the event details.

    #956845
    Brian
    Member

    You 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.

    #956853
    Daniel Maier
    Participant

    EXCELLENT!

    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 21

    Thanks so much for working on this with me!

    #956862
    Brian
    Member

    Ok 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

    #956865
    Daniel Maier
    Participant

    I 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!

    #956993
    Daniel Maier
    Participant

    Hi 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!

    #957007
    Brian
    Member

    I 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!

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Notice: Undefined offset’ is closed to new replies.