JS bug with recurring event end date for Events Calendar Pro 3.11.1

Home Forums Calendar Products Events Calendar PRO JS bug with recurring event end date for Events Calendar Pro 3.11.1

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #994379
    SiteCrafting
    Participant

    Our QA engineer filed a bug report (pasted below), where trying to save a recurring event without a recurrence end date renders the publish button unusable. I believe I’ve tracked down the issue to a JS conflict between your plugin (Events Calendar Pro 3.11.1) and Advanced Custom Fields Pro (version 5.2.8).

    The reason I’m posting here is because I think the fix that makes the most sense would affect your plugin. I believe the issue lies with the submit event handler defined in /events-calendar-pro/src/resources/js/events-admin.js on lines 67 and 89 (not sure why it’s in there twice). If there isn’t a valid recurrence end date, this handler alerts the user of the error and calls e.preventDefault() to prevent the submission. However, preventDefault doesn’t stop the propagation of this event (see this StackOverflow article for more details). I’d propose adding in a call to e.stopPropagation() or a return false at the end of the conditional in this event handler. This should prevent additional submit event handlers (like the one from the ACF plugin) from running as well.

    TL;DR:

    Change this:

    $( '.wp-admin.events-cal #post' ).submit( function( e ) {
    	if ( !validRecEnd() ) {
    		e.preventDefault();
    		alert( $( '#rec-end-error' ).text() );
    		$( '#rec-end-error' ).show();
    		resetSubmitButton();
    	}
    } );

    to this:

    $( '.wp-admin.events-cal #post' ).submit( function( e ) {
    	if ( !validRecEnd() ) {
    		alert( $( '#rec-end-error' ).text() );
    		$( '#rec-end-error' ).show();
    		resetSubmitButton();
    		return false;
    	}
    } );

    Thoughts?

    ______________________________________________________

    Bug Report Summary:
    If I am creating or editing an event, one that is reoccurring in particular, it is possible to have the Publish/Update and Save Draft buttons become unusable.
    To do this, when you are creating a new event (or editing an existing one although this would take some extra steps to accomplish) if you forget to set the “end date” for the reoccurring nature of the event, and you click the Publish button you will get a message that you first need to set the end date.
    After setting the end date though, all of the buttons related to saving a draft or publishing the event become unusable. There is no way that I can see to get these buttons to work again, aside from leaving the edit event screen, finding it in the drafts section, and fixing the end date there before clicking publish.

    Steps To Reproduce:

    • Setup a fake test event, and make the event reoccurring in the Time & Date portion, but DO NOT assign an end date for the reoccurring events yet.
    • Once everything except the end date is in place, click Publish
    • Error will come up telling you to set the end date, so do that now
    • Now try to click Publish (or Save Draft)
    • Unable to click either of these buttons (as well as the Preview button)
    • This topic was modified 10 years, 8 months ago by SiteCrafting.
    #994586
    George
    Participant

    Wow, the detail supplied here by both you and your QA Engineer is greatly appreciated!

    I’ve logged this bug in our system, and if we confirm your findings I assure you that a fix for this bug will be included in the next release or the one after it.

    Thank you!
    George

    #998370
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

    #1001848
    Leah
    Member

    Hi there,

    I wanted to report back to you on the status of this issue. Your report is tracked in our internal system and a fix is on our to-do list, but we were not able to fit it into our upcoming 3.12 release. Please know that the issue is still very much on our radar and we will be working on it for a future release. We appreciate your patience while we work to improve our plugins. Thank you for using The Events Calendar!

    Best,
    Leah
    and The Events Calendar team

    #1002308
    George
    Participant

    🙂

    #1088624
    Leah
    Member

    Hi there,

    I wanted to drop in here and let you know that a fix for this problem is included in our upcoming release. Keep an eye on your Updates page for the new version and watch our blog for the release notes post.

    If you experience any issues after updating your plugins to the new versions, please open a new thread in the forum and we’d be happy to take a look.

    Thank you for your patience while we expand and improve our plugins!

    Best,
    Leah

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘JS bug with recurring event end date for Events Calendar Pro 3.11.1’ is closed to new replies.