Forum Replies Created
-
AuthorPosts
-
focusphotoParticipant
Thanks Victor,
Just installed it and the code is fine now!
We actually had patched this locally anyway while waiting for your fix, but at least now the fix is in your official code so your other users can benefit too. 🙂
Regards
ArunfocusphotoParticipantHi Victor,
No problems at all. I think you may have missed it but I had another reply above with the solution and the patch I applied locally to have it working.
If you shared that with your developers it might assist them with a quicker fix 🙂
Here is the link to the exact code causing the problem (at least for our install):
https://theeventscalendar.com/support/forums/topic/error-on-add-event-page-community-events/#post-1594741Regards
ArunfocusphotoParticipantHi Victor,
Ok I have also found the offending code in your codebase that is actually causing this problem.
In addition to the Asset loading change above, in the new version of Community Events, the JS scripts are unloaded in your code as below.
On Line 476 of the-events-calendar-community-events/src/Tribe/Main.php :
tribe( 'assets' )->remove( 'tribe-events-calendar-script' );
This line is removing the JS file needed, for the Add Event page to correctly show the dropdowns / Date Pickers etc. It then is not getting loaded correctly after that.
As an example, I have commented out the line, and it is loading perfectly after that. See attached screenshots.
Obviously this is NOT a conflict with any other extension, but a clear bug in your code. Please can you get your developers to push out a fix when possible.
focusphotoParticipantHi Victor,
I’ve definitely found what changed in your code between the versions. As I mentioned above, the errors are due to JS array called tribe_js_config not being loaded.
This bug started happening after your base Events Calendar changed the way these JS files was loaded.
It used to be loaded via a file: the-events-calendar/src/Tribe/Asset/Calendar_Script.php :
class Tribe__Events__Asset__Calendar_Script extends Tribe__Events__Asset__Abstract_Asset {public function handle() { .............. wp_localize_script( $handle, 'tribe_js_config', $js_config_array ); } }
This has been replaced in a recent update to be loaded via the-events-calendar/src/Tribe/Assets.php :
tribe_asset( $plugin, 'tribe-events-calendar-script', 'tribe-events.js', array( 'jquery', 'tribe-events-bootstrap-datepicker', 'tribe-events-jquery-resize', 'jquery-placeholder' ), 'wp_enqueue_scripts', array( 'conditionals' => array( $this, 'should_enqueue_frontend' ), 'in_footer' => false, 'localize' => array( 'name' => 'tribe_js_config', 'data' => array( $this, 'get_js_calendar_script_data' ), ), ) );
For whatever reason, this change is causing the array not to get loaded anymore.
Could this be trying to load the files in a way that is incompatible with us using Cloudflare, perhaps?
Is this something you could please escalate and check with your developers.
focusphotoParticipantBy the way, I do see this user reporting the identical issue:
https://theeventscalendar.com/support/forums/topic/community-events-date-time-venue-organizer/Not sure if their one is the conflict with the plugin you mentioned or not, but it looks like the same issue we have.
Right down to the exact same Javascript errors (word for word identical error) 🙂
focusphotoParticipantHi Victor,
Thanks for getting back to me. Yes we dont use the Google Maps / Multiple Events plugin.
I have installed the updated version for the Relabeller but that doesnt fix the issue. Not surprising since I had disabled that plugin before and had not seen it working ( so it wasnt the cause).
Yes a staging server would be nearly impossible for me to set up. This is essentially a client’s site with very limited resources.
I am going through your Community events code now, and comparing it to previous versions from our backups – when this bug was not there.
If you are able to share a demo site where I can see this latest version of your community event “add event” page working properly, it will help me debug much easier.
Regards
ArunfocusphotoParticipantHi Victor,
I am happy to try and debug the code on our end. I suspect there is another javascript file that is meant to be loaded before the tribe-events.js which sets tribe_js_config which is not getting loaded in your latest updates, for some reason.
Could you please share a demo site URL where the Add Event page is accessible publicly (or share a login please) so I can compare the JS that is meant to get loaded?
Thanks
ArunfocusphotoParticipantFYI root cause of this issue appears to be with the tribe_js_config variable in the JS files being loaded by events calendar.
Uncaught ReferenceError: tribe_js_config is not defined at tribe-events.min.js?ver=4.6.21:formatted:573
I notice another user reported this specific variable too, but I can’t see the resolution since the thread is private:
https://theeventscalendar.com/support/forums/topic/browser-errors-tribe_js_config/focusphotoParticipantHi Victor,
Thanks for getting back. I have now opted in to the sharing of system info. Let me know if you are able to debug this further.
Yes we tried disabling plugins earlier (as I mentioned above) it did not help at all. Unfortunately we can’t keep it running in that state so had to restore our usual setup back.
Please note this was working perfectly until your plugin got the most recent update. As you can see multiple users are reporting the same bugs within the same timeframe!
Regards
ArunfocusphotoParticipantAnd yet another user with the same bug:
https://theeventscalendar.com/support/forums/topic/community-events-date-time-venue-organizer/focusphotoParticipantLooks like the JS errors we are seeing are the same sort of errors this user reported in another thread in the last few days too:
https://theeventscalendar.com/support/forums/topic/bug-the-events-calendar-pro-extension/It appears your latest updates have introduced this bug.
Can a moderator / admin please escalate this to the development team and get back to us?
focusphotoParticipantJust thought I would add this here – I think it’s related to the problems above.
I’ve noticed the following JS / Jquery errors are showing up in the web console for this page (see attached).
focusphotoParticipantJust wanted to report back that I added this bit of extra code to force the descending order sort.
This – along with your code above for using published date, has fixed the behaviour.
// Change sort order of RSS to Desc -> i.e. NEW posts at TOP. function alter_wp_sort_desc( $request ) { $dummy_query = new WP_Query(); $dummy_query->parse_query($request); if($dummy_query->is_feed()) $request['order'] = 'DESC'; return $request; } add_filter('request', 'alter_wp_sort_desc');
focusphotoParticipantActually I have found this help document which has the code snipped for ordering Events by Publication Date:
https://theeventscalendar.com/knowledgebase/customize-rss-feed/add_action( 'pre_get_posts', 'custom_teardown_tribe_order_filter', 60 ); function custom_teardown_tribe_order_filter() { if ( is_feed() ) remove_filter( 'posts_orderby', array( 'Tribe__Events__Query', 'posts_orderby' ), 10, 2 ); }
However it is not working correctly. Still shows events added later to the bottom of the feed. 🙁
December 22, 2017 at 5:12 pm in reply to: Uncheck google maps by default (venue details) – Community Events #1412053focusphotoParticipantHi there,
Okay I got it working, I had to add in some additional lines into the function. This seems to make it work:
update_post_meta( $event_id, '_EventShowMapLink', 'false' );
update_post_meta( $event_id, '_EventShowMap', 'false' );Thanks for sorting this out for us!
Regards
Arun -
AuthorPosts