Week calendar view time length

Home Forums Calendar Products Events Calendar PRO Week calendar view time length

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #1377902
    Jennifer
    Keymaster

    Hi Mitchell,

    I do wish that I had a quick fix for you, but we still need to figure out exactly where the problem is coming from. We are not able to login to user sites, but I ran this issue by one of our developers. He recommended enabling Full Debug modeĀ (in Events > Help > Event Log) and adding this snippet to your functions.php file:

    function log_week_attributes( $attributes ) {
    static $count = 0;
    $count++;

    $message = sprintf(
    'Week view debug: duration - %d %s',
    @$attributes['data-duration'],
    $count % 2 ? 'early' : 'late'
    );

    Tribe__Main::instance()->log()->log_debug( $message, 'Week View Debugger' );
    return $attributes;
    }

    function debug_week_attributes() {
    add_filter( 'tribe_events_week_event_attributes', 'log_week_attributes', 1 );
    add_filter( 'tribe_events_week_event_attributes', 'log_week_attributes', 20 );
    }

    debug_week_attributes();

    Then, after viewing the week view a couple of times, go back to this page and copy/paste the log into your reply. I really want to help you get this fixed, so please let me know what you find!

    Thanks,

    Jennifer

    #1377905
    Mitchell Mink
    Participant

    Hi,

    I added it to the functions.php but ended up with a blank screen. I do not see any events at all in the log.

    #1378530
    Barry
    Member

    Hi Mitchell,

    I’m sorry to hear that didn’t work for you. That being the case, though, let’s strip out that code (if you haven’t already done so).

    The problem here is we don’t see this problem ourselves despite our best efforts to replicate: it’s also not something where we’re seeing lots of similar reports from other users … that does tend to indicate that – for some reason – the problem is specific to your site.

    How about this: can you build a testing/staging site? Lots of web hosts make this a snap – even if they don’t provide dedicated staging facilities you can usually install a fresh copy of WordPress in a sub-directory – ie example.com/test-site/ – in a matter of minutes.

    With that done, install The Events Calendar, Events Calendar PRO and nothing else. Create a few test events and take a peek at week view — do you see the same problem as you do in your live site? If you do, please pause and let us know, providing a link to the staging site.

    On the other hand, if you don’t see the problem and everything works as expected that would bear out that the problem is specific to your existing live site: to find the source of the conflict, you can simply start incrementally adding the same plugins and ultimately the same theme and see which of those components trigger the problem.

    I appreciate this may seem similar to the steps we already recommended, but we’ve found in the past that this is an effective alternative way of ensuring other customizations and plugins/theme code are not interfering and that we’re not left with ‘corrupted’ data (since, even if you switch to a default theme and deactivate other plugins on your live site, it’s sometimes possible that the “damage” has already been done to your events).

    Let me know if this is possible — thanks!

    #1382209
    Mitchell Mink
    Participant

    This reply is private.

    #1382213
    Mitchell Mink
    Participant

    This reply is private.

    #1382437
    Barry
    Member

    OK, well good to hear it’s not a bug on our side but rather is an artefact of that other plugin and the way it imports data.

    In terms of automatically saving the events post-import, you could try writing a script (and saving it as a custom plugin) that listens for events being created outside of The Events Calendar’s framework and then makes a call to tribe_update_event(), something like this:

    function trigger_tribe_update_event( $id ) {
    	static $processed = array();
    
    	if ( in_array( $id, $processed ) ) {
    		return;
    	}
    
    	$processed[] = $id;
    	tribe_update_event( $id, array() );
    }
    
    add_action( 'save_post_tribe_events', 'trigger_tribe_update_event' );

    Please note that:

    • This will trigger a number of notice/warning level errors (that can be ignored) so do turn off the display of errors before using it
    • It will make WordPress/The Events Calendar do a lot of extra work that wouldn’t normally happen, so consider removing it/commenting it out when it is not needed
    • I’m making some assumptions about how your other plugin works here and so I’m afraid I can not offer any guarantees about this working – but it’s worth a shot and could be a good starting point for you

    Good luck and thanks for the update!

    #1399480
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 16 through 22 (of 22 total)
  • The topic ‘Week calendar view time length’ is closed to new replies.