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 10 years, 1 month ago.
-
AuthorPosts
-
August 22, 2014 at 7:53 am #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 HydeAugust 22, 2014 at 11:52 am #12227That’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 HarrisAugust 25, 2014 at 5:26 pm #12265It 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 HydeAugust 26, 2014 at 1:33 pm #12273This 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 HydeAugust 26, 2014 at 1:44 pm #12274The 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 HarrisAugust 26, 2014 at 1:44 pm #12275I’m trying to test the plug-in now, but it doesn’t event appear to be translating the normal WordPress (posts) calendar…
Stephen HarrisAugust 26, 2014 at 2:58 pm #12276Ah, 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 HarrisSeptember 8, 2014 at 11:40 am #12473But 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 HydeSeptember 8, 2014 at 12:27 pm #12474$calendar
is an array which indexed by cache keys (which depends on the locale).Stephen HarrisSeptember 8, 2014 at 1:50 pm #12476ok,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 HydeSeptember 9, 2014 at 4:56 pm #12516Ah, 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 HarrisSeptember 9, 2014 at 7:35 pm #12517Thanks 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 HydeSeptember 17, 2014 at 10:48 am #12613Hi 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 HarrisOctober 1, 2014 at 11:22 am #12849It 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 HydeOctober 1, 2014 at 6:04 pm #12856At 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 -
AuthorPosts