Full Calendar when event content empty

WordPress Event Management, Calendars & Registration Forums Report A Bug Full Calendar when event content empty

This topic contains 14 replies, has 2 voices, and was last updated by  Stephen Harris 9 years, 6 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #12226

    When an event has been published, but the content box is empty. So just a date/time, the Full Calendar breaks and does not display when viewing a range that includes that event.

    Tim Hyde
    #12227

    That’s odd, so you when you publish an event with content it appears on the calendar? If you published an event without content and then add it and publish the event, does it then appear?

    Does the admin calendar work as expected? Can you provide a link to the site? (If you don’t want it to be made public you can use this form).

    Stephen Harris
    #12265

    It seems ok now!??!

    But I do have another question. We are using Polylang. But on full calendar view the events do change language when user switches language.

    Any ideas?

    Tim Hyde
    #12273

    This appears to be because event organiser caches the full calender query. So you get the last language set when using Polylang.

    The only way I can get this to work is remove caching feature.

    Any other suggestions?

    Tim Hyde
    #12274

    The cache key includes the language, so if the language changes, so should the cache key. (It uses get_locale() – does polylang filter that value?)

    Stephen Harris
    #12275

    I’m trying to test the plug-in now, but it doesn’t event appear to be translating the normal WordPress (posts) calendar…

    Stephen Harris
    #12276

    Ah, silly me. I had another ‘language switcher’ plug-in activated which was forcibly setting it to English.

    After a bit of digging, I have found that Polylang should be storing the selected locale in your browser’s cookies. For me this wasn’t workign because of a bug in Polylang (see (the end of) this thread).

    If this is a localhost site then you are probably experiencing the same bug. Otherwise, you might want to investigate why Polylang’s cookie is not being stored.

    Stephen Harris
    #12473

    But in event organizer the code in event-organiser-ajax is:

    set_transient( “eo_full_calendar_public{$priv}”,$calendar, 606024);

    Which does not include any locale info?

    Tim Hyde
    #12474

    $calendar is an array which indexed by cache keys (which depends on the locale).

    Stephen Harris
    #12476

    ok,sorry missed that.

    But still not working right for me.

    I grabbed the dev version of Polylang, which seemed to improve things on localhost but only if I disable the transient cache that eo is using. Without the caching, the events are returned in correct language.

    But with caching enabled, I only get one language.

    I don’t see where you are storing the locale in the $calendar array key.
    I logged the query you are using to gen key.

    //Retrieve events       
        $query    = array_merge( $request, $presets );
        _log($query);
    
        $key      = "eo_fc_".md5( serialize( $query ). $time_format );
        $calendar = get_transient( "eo_full_calendar_public{$priv}");

    Which logs:

    [08-Sep-2014 12:31:56 UTC] Array
    (
        [event_start_before] => 2014-10-06
        [event_end_after] => 2014-09-01
        [numberposts] => -1
        [group_events_by] => 
        [showpastevents] => 1
    )

    No sign of any locale? Or am I missing something?

    But on my dev server it doesn’t even work with caching disabled. This I suspect is more to do with Polylang, but if I check current language when eo_get_events is called on the ajax calls, the language is always the default. It doesn’t pick up locale.

    I’d love to get these two plugins working properly together, any ideas?

    Tim Hyde
    #12516

    Ah, I’m terrible sorry Tim. In the course of this thread I’ve switched from the fullCalendar to the widget calendar. You are right, the fullCalendar doesn’t include a locale in the cache key as “translation” of the calendar is performed client-side, but I can see this will present an issue for multilingual plugins where the data itself is translated.

    I’ll release a patch update shortly to address this, (though this may take the form of a setting to be configured in wp-config.php if it seems a fix might reasonable ‘break’ existing behaviour). In the mean time, removing the use of the cache (or using a locale-aware key) should fix the problem (as you have stated).

    Stephen Harris
    #12517

    Thanks for your help.

    Let me know when you release patch. Or I can just watch github.

    I still seem to have an issue with the ajax on my live server. Polylang does not appear to pick up language on ajax there even with cache disabled. Seems more like the issue you found with the localhost, but localhost is fine!

    Tim Hyde
    #12613

    Hi Tim,

    Just to let you know, as of 2.9.0 (released 16th September), the fullCalendar cache key includes the locale if Polylang is enabled (for events). I hope you’re able to resolve the remaining problem with Polylang not remembering the language selection.

    Stephen Harris
    #12849

    It seems to work on my local machine, but not on the live server. It seems to think locale is default en when ajax call is made by calendar.

    Tim Hyde
    #12856

    At a guess, perhaps you have cookies disabled on your browser for your live site? Polylang uses a cookie to remember the language selection, and I can’t imagine that your live server doesn’t set/retrieve cookies when your test server does – unless the browser has been instructed not to store cookies. You should be able to check what cookies are stored in browser to verify this.

    Stephen Harris
Viewing 15 posts - 1 through 15 (of 15 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.