Help Desk

Error on "Add Event" Page (community events)

  • Posts: 16 Topics: 3
    | Permalink

    Hi there,

    We have started seeing a bug (3 issues) on the Add Event page for community events.

    This only started showing up recently, I believe since we updated to the latest plugin update in the last few days.

    1. Event Date field is not showing calendar picker anymore
    2. Event Location / Venue selection is showing as blank – dropdown not showing
    3. Event Organizer selection is showing as blank – dropdown not showing

    Note we have customized our display to call these “Shoots” rather than events, but even without the renaming, the same problems are occurring.

    Screenshot attached.

    Regards
    Arun

    Posts: 16 Topics: 3
    | Permalink

    Just 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).

    Posts: 16 Topics: 3
    | Permalink

    Looks 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?

    Posts: 16 Topics: 3
    Posts: 6240 Topics: 17
    | Permalink

    Hi Arun,

    Thanks for taking the time to report this issue and for sending over the information you’ve found so far.

    I made a few tests on my end but I’m not able to reproduce this, so let me help you with the troubleshooting so we can hopefully find the source of the problem.

    First, could you please share with us your system information by following this guide > https://theeventscalendar.com/knowledgebase/sharing-sys-info/ ? We’ll see if there is anything strange that would indicate an error from there.

    Also, did you happen to notice a difference when deactivating all other plugins or switching to a default WordPress theme, like Twenty Seventeen? What happens if you try deactivating all plugins and switching to the Twenty Seventeen theme together? Do you notice a difference then?

    If you see no difference in those conditions, then we’ll need to do some deeper troubleshooting

    Thanks,
    Victor

    Posts: 16 Topics: 3
    | Permalink

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

    Posts: 16 Topics: 3
    | Permalink

    FYI 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/

    Posts: 16 Topics: 3
    | Permalink

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

    Posts: 6240 Topics: 17
    | Permalink

    Hi Arun,

    Thanks for following up with this.

    The related threads you mention seem to be a conflict with one of our extensions > https://theeventscalendar.com/extensions/google-maps-multiple-events-same-venue/ which I don’t see you are using since you don’t have it installed.

    However, I do see you have our The Events Calendar Extension: Relabeler version 1.0.0. You are using the previous versions of it, so could you please try downloading and installing the latest version from https://theeventscalendar.com/extensions/change-labels-events-venues-organizers/ and see if any change?

    Unfortunately, I’m not able to reproduce the error replicating your site’s setting in my local installation.

    Unfortunately we can’t keep it running in that state so had to restore our usual setup back.

    I definitely understand this. We always suggest to setup a dev/staging site so you can test things out and make all plugins, theme and WordPress core updates without disrupting the live site. Is this something you can setup and share a link with us, in a private reply if you’d like?

    If that’s not possible, I may be able to setup a sandbox site for you to check it out. I’ll reach out to the team about it.

    Thanks,
    Victor

    Posts: 16 Topics: 3
    | Permalink

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

    Posts: 16 Topics: 3
    | Permalink

    By 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) 🙂

    Posts: 16 Topics: 3
    | Permalink

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

    Posts: 16 Topics: 3
    | Permalink

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

    Posts: 6240 Topics: 17
    | Permalink

    Hi Arun,

    Thanks so much for investigating this on your end and keeping us posted about it 🙂

    It definitely seems related to the assets change we made in our latest release of our plugins.

    I have created a bug report so our developers can investigate this further and hopefully find a fix for it. I have also link the other threads to the report and flagged this to the team so we can be aware of it.

    I will set this thread’s status to “Pending Fix” and link it to the report. This way, we will notify you once a fix is released.

    In the meantime, the only workaround I’ve found is to downgrade to a previous version of The Events Calendar and Community Events. As a reference, we have a guide on how you can downgrade a plugin to a previous version > https://theeventscalendar.com/knowledgebase/downgrading-plugin-past-version/

    We apologize for the inconvenience and we appreciate your patience while we work on this.

    Best,
    Victor

    Posts: 16 Topics: 3
    | Permalink

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

    Regards
    Arun

    Posts: 6240 Topics: 17
    | Permalink

    Hi Arun,

    Thanks again for following up with this.

    I have already flagged the code you mentioned in the bug report so the developers can take it into account when addressing the issue.

    We’ll keep you posted as soon as we have an update.

    Best,
    Victor

    Posts: 6240 Topics: 17
    | Permalink

    Hi Arun!

    Just wanted to share with you that a new release of Community Events is out, including a fix for this issue.

    Find out more about this release → https://theeventscalendar.com/announcing-the-events-calendar-4-6-22-1-and-community-events-4-5-13-1/

    Thanks for your patience and help while we worked on this.

    As always, we suggest to setup a dev/staging site so you can make all plugin updates without disrupting the live site.

    Please update your plugins and let us know if the fix works for your site.

    Best,
    Victor

    Posts: 16 Topics: 3
    | Permalink

    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
    Arun

    Posts: 6240 Topics: 17
    | Permalink

    Hey Arun!

    Glad to know it’s working fine for you. Thanks for following up to let us know.

    I’ll go ahead and close this, but feel free to open a new topic if anything comes up and we’ll be happy to help.

    By the way, how about leaving a review on our wordpress.org page? 😉

    Cheers,
    Victor

    | Permalink