Support » Plugin: Events Manager » Event Manager 5.9.8 date picker no longer works

  • Resolved donmcmahan

    (@donmcmahan)


    The datepicker feature in Events Manager 5.9.8 has stopped working. The pop-up calendar no longer appears when I click in the “From” or “To” field. I’ve deactivated all my plugins, changed Themes, and even changed versions of PHP. If the problem might be related to a plugin is there a way to list the plugins by date installed? Without the datepicker I can’t post any events.

    Thanks so much for your help.

    Don McMahan
    Macon Tracks Running Club
    Macon, Georgia

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    You can also try to install and activate WP Safe Mode to easily narrow down the problem; also, the latest EM version is 5.9.8.1 with Dev version 5.9.8.2

    https://wp-events-plugin.com/documentation/upgrade-dev-version/

    Thread Starter donmcmahan

    (@donmcmahan)

    I’ve yet to come up with a solution either to this problem. I tried WP Safe Mode, too. I have finally had to resort to adding events through SQL.

    Aurore

    (@aurore888)

    Hello,
    I had the same problem today : the datepicker and the booking button were not working. I noticed that if “limit JS file loading” is set to yes, many scripts are missing even if the page id is added in “General JS” (I use extra theme).

    To solve this problem, I added this function in my child template :

    For `
    function my_styles_and_scripts() {

    // Dequeue Events Manager scripts if not needed
    if( !is_page( array (‘events’, ‘locations’, ‘new-event’) ) && !is_singular(array(‘event’, ‘location’) ) && !bp_is_current_component(‘events’) ) {
    wp_dequeue_style( ‘events-manager’ );
    wp_dequeue_script( ‘events-manager’ );
    }

    // Enqueue jquery-ui & datepicker for new events
    if( is_page( array (‘events’, ‘locations’, ‘new-event’) ) || is_singular(array(‘event’, ‘location’) ) || bp_is_current_component(‘events’) ) {
    wp_enqueue_script(‘jquery-core’);
    wp_enqueue_script(‘jquery-ui-core’);
    wp_enqueue_script(‘jquery-ui-datepicker’);
    wp_enqueue_style( ‘events-manager’ );
    wp_enqueue_script( ‘events-manager’ );
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘my_styles_and_scripts’, 100 );
    `
    I Hope this will work for you too.
    Best regards

    Thread Starter donmcmahan

    (@donmcmahan)

    aurore888,
    Thanks for your solution, but can you be more specific on where in the child theme I should put your code.

    When I started adding in this code everywhere I put it caused a crash. I finally found a couple places to put the code that didnt cause a crash. They also did not cause any change in the problem.

    Any help will be greatly appreciated.

    Don

    Hello,

    Sorry to read this Don, I’ll do my best to help you.

    The code goes in /wp-content/themes/your-child-theme-name/functions.php.

    My previous code doesn’t work because the forum editor has replaced the symbol : ‘ by ’. Sorry I can not edit the post so I try to paste it again with more details:

    
    function my_styles_and_scripts() {
    
        // Remove Events Manager files where they are not needed
        if( !is_page( array ('events', 'locations', 'new-event') ) && !is_singular(array('event', 'location') ) && !bp_is_current_component('events') ) {
        wp_dequeue_style( 'events-manager' );
        wp_dequeue_script( 'events-manager' );
        }
        
        // Add Events Manager files on these pages
        if( is_page( array ('events', 'locations', 'new-event') ) || is_singular(array('event', 'location') ) || bp_is_current_component('events') ) {
        wp_enqueue_script('jquery-core');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
        wp_enqueue_style( 'events-manager' );
        wp_enqueue_script( 'events-manager' );
        }
        
    }
    // 100 is the priority, please increase this number if this script do not work 
    add_action( 'wp_enqueue_scripts', 'my_styles_and_scripts', 100 );
    
    

    Please replace the slug of my pages by yours after if( is_page( array (‘the-slug-of-the-page’, ‘the-slug-of-the-page’, ‘the-slug-of-the-page’) )

    is_singular(array(‘event’, ‘location’)) check if this is the event or location post type.

    bp_is_current_component(‘events’) check if this is the Events BuddyPress component. So you can remove this part if you are not using the BuddyPress plugin or the Buddyboss platform.

    People who use the map will have to add more files depending on the plugin they use. It is not included in my exemple.

    Please let me know if you need more details.

    Kind regards

    @donmcmahan The link to “the page you need help with” is not accessible without password. So it’s hard to help more.

    
        wp_enqueue_script('jquery-core');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-datepicker');
    
    

    This part of the code calls the Jquery and Jquery UI files included natively in WordPress. Here is the result I have with WordPress 5.6 :
    https://my-site.com/wp-includes/js/jquery/jquery.min.js?ver=3.5.1
    https://my-site.com/wp-includes/js/jquery/ui/core.min.js?ver=1.12.1
    https://my-site.com/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.12.1

    The Datepicker works fine with these versions.

    My general setting are :
    limit Js files = yes + I’ve added the page id of the new event page in the field “new event form”.
    limit css files = yes

    All other fields are left empty and it works this way even on buddypress pages.

    I forgot many jquery ui scripts for the event & booking forms, so the final code is :

    
    function my_styles_and_scripts() {
    
        // Remove Events Manager files where they are not needed
        if( !is_page( array ('events', 'locations', 'new-event') ) && !is_singular(array('event', 'location') ) && !bp_is_current_component('events') ) {
        wp_dequeue_style( 'events-manager' );
        wp_dequeue_script( 'events-manager' );
        }
        
        // Add Events Manager files on these pages
        if( is_page( array ('events', 'locations', 'new-event') ) || is_singular(array('event', 'location') ) || bp_is_current_component('events') ) {
        wp_enqueue_script('jquery-core');
        wp_enqueue_script('jquery-ui-core');
        wp_enqueue_script('jquery-ui-autocomplete');
        wp_enqueue_script('jquery-ui-button');
        wp_enqueue_script('jquery-ui-controlgroup');
        wp_enqueue_script('jquery-ui-datepicker');
        wp_enqueue_script('jquery-ui-checkboxradio');
        wp_enqueue_script('jquery-ui-dialog');
        wp_enqueue_script('jquery-ui-draggable');
        wp_enqueue_script('jquery-ui-menu');
        wp_enqueue_script('jquery-ui-mouse');
        wp_enqueue_script('jquery-ui-resizable');
        wp_enqueue_script('jquery-ui-sortable');
        wp_enqueue_style( 'events-manager' );
        wp_enqueue_script( 'events-manager' );
        }
        
    }
    // 100 is the priority, please increase this number if this script do not work 
    add_action( 'wp_enqueue_scripts', 'my_styles_and_scripts', 100 );
    
    

    But I’m still working on it…

    • This reply was modified 11 months, 4 weeks ago by Aurore.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Event Manager 5.9.8 date picker no longer works’ is closed to new replies.