Support » Plugin: The Events Calendar » Deactivating The Events Calendar is causing “technical difficulties”

  • Hello,

    Deactivating the plugin is causing “The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.” and don’t have access to the dashboard

    I receive then an e-mail to regain access to the site (I think related with the new WordPress Site Health feature) but it doesn’t work either.

    I’m using the Version 4.9.3.2, PHP 7.3 and WP 5.2.2.

    Anyone experiencing the same issue? Fix suggestions?

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor András Guseo

    (@aguseo)

    Hi @pchenriques

    Thanks for reaching out!

    I could reproduce this when I had some custom code for TEC in the functions.php

    When the issue was there I got a more detailed error on the screen which pointed to the functions.php file. For this you might need to turn on WP_DEBUG in your wp-config.php file.

    Once I switched to a default theme like twentysixteen, then I couldn’t reproduce the issue any more.

    Hope this helps.
    Andras

    @pchenriques Were you able to resolve this at all by checking for a custom function in your theme?

    Hello,

    Thanks for the feedback. I do have some custom code applied to functions.php and related with The Events Calendar plugin:

    
    /* Order events in main blog loop by post date.
     * https://support.theeventscalendar.com/641498-Order-events-in-main-blog-loop-by-post-date */
    add_action( 'pre_get_posts', 'tribe_post_date_ordering', 51 );
    
    function tribe_post_date_ordering( $query ) {
    	if ( ! empty( $query->tribe_is_multi_posttype ) ) {
    		remove_filter( 'posts_fields', array( 'Tribe__Events__Query', 'multi_type_posts_fields' ) );
    		$query->set( 'order', 'DESC' );
    	}
    }
    
    /* Changes past event views to reverse chronological order */
    function tribe_past_reverse_chronological ($post_object) {
    	$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false;
    	if(tribe_is_past() || $past_ajax) {
    		$post_object = array_reverse($post_object);
    	}
    	return $post_object;
    }
    add_filter('the_posts', 'tribe_past_reverse_chronological', 100);
    

    Do I have to change this code in anyway to solve the issue?

    Meanwhile, I will turn on WP_DEBUG and check get back with the results.

    Thanks

    From DEBUG log before trying to deactivate the TEC:

    PHP Notice: Undefined index: tribe_event_display in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php on line 17

    Being line 17: $past_ajax = (defined( ‘DOING_AJAX’ ) && DOING_AJAX && $_REQUEST[‘tribe_event_display’] === ‘past’) ? true : false;

    After trying deactivating TEC and getting into “technical difficulties” with the DEBUG activated got message:

    Fatal error: Uncaught Error: Call to undefined function tribe_is_past() in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php:18 Stack trace: #0 /home/cebsolut/public_html/staging01/wp-includes/class-wp-hook.php(288): tribe_past_reverse_chronological(Array) #1 /home/cebsolut/public_html/staging01/wp-includes/plugin.php(251): WP_Hook->apply_filters(Array, Array) #2 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3152): apply_filters_ref_array(‘the_posts’, Array) #3 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3404): WP_Query->get_posts() #4 /home/cebsolut/public_html/staging01/wp-includes/post.php(1961): WP_Query->query(Array) #5 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/functions/helpers.php(2058): get_posts(Array) #6 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/config/theme-options.php(25): us_get_posts_titles_for(‘page’) #7 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/functions/helpers.p in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php on line 18

    and from DEBUG log:

    [26-Jun-2019 13:42:52 UTC] PHP Fatal error: Uncaught Error: Call to undefined function tribe_is_past() in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php:18
    Stack trace:
    #0 /home/cebsolut/public_html/staging01/wp-includes/class-wp-hook.php(288): tribe_past_reverse_chronological(Array)
    #1 /home/cebsolut/public_html/staging01/wp-includes/plugin.php(251): WP_Hook->apply_filters(Array, Array)
    #2 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3152): apply_filters_ref_array(‘the_posts’, Array)
    #3 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3404): WP_Query->get_posts()
    #4 /home/cebsolut/public_html/staging01/wp-includes/post.php(1961): WP_Query->query(Array)
    #5 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/functions/helpers.php(2058): get_posts(Array)
    #6 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/config/theme-options.php(25): us_get_posts_titles_for(‘page’)
    #7 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/functions/helpers.p in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php on line 18
    [26-Jun-2019 13:42:52 UTC] PHP Fatal error: Uncaught Error: Call to undefined function tribe_is_past() in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php:18
    Stack trace:
    #0 /home/cebsolut/public_html/staging01/wp-includes/class-wp-hook.php(288): tribe_past_reverse_chronological(Array)
    #1 /home/cebsolut/public_html/staging01/wp-includes/plugin.php(251): WP_Hook->apply_filters(Array, Array)
    #2 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3152): apply_filters_ref_array(‘the_posts’, Array)
    #3 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3404): WP_Query->get_posts()
    #4 /home/cebsolut/public_html/staging01/wp-includes/post.php(1961): WP_Query->query(Array)
    #5 /home/cebsolut/public_html/staging01/wp-includes/post.php(614): get_posts(Array)
    #6 /home/cebsolut/public_html/staging01/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-with-media-files.php(183): get_children(Array)
    #7 /home/cebsolut/public_html/staging01/wp-content/plugins/wpml-med in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php on line 18
    [26-Jun-2019 13:43:55 UTC] PHP Notice: Undefined index: tribe_event_display in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php on line 17
    [26-Jun-2019 13:43:55 UTC] PHP Fatal error: Uncaught Error: Call to undefined function tribe_is_past() in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php:18
    Stack trace:
    #0 /home/cebsolut/public_html/staging01/wp-includes/class-wp-hook.php(288): tribe_past_reverse_chronological(Array)
    #1 /home/cebsolut/public_html/staging01/wp-includes/plugin.php(251): WP_Hook->apply_filters(Array, Array)
    #2 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3152): apply_filters_ref_array(‘the_posts’, Array)
    #3 /home/cebsolut/public_html/staging01/wp-includes/class-wp-query.php(3404): WP_Query->get_posts()
    #4 /home/cebsolut/public_html/staging01/wp-includes/post.php(1961): WP_Query->query(Array)
    #5 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/functions/helpers.php(2058): get_posts(Array)
    #6 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/config/theme-options.php(25): us_get_posts_titles_for(‘page’)
    #7 /home/cebsolut/public_html/staging01/wp-content/plugins/us-core/functions/helpers.p in /home/cebsolut/public_html/staging01/wp-content/themes/Impreza-child/functions.php on line 18

    Any suggestion to fix it?

    Thanks

    Plugin Contributor András Guseo

    (@aguseo)

    Hi @pchenriques

    If you are using any tribe functions, then you need to use if(function_exists('tribe_function')){
    prior to calling it.

    That should help you avoid this issue down the road.

    Hi, @aguseo

    Sorry, not skilled enough to digest your line of code… 🙂

    How it would update the code I mention above that I’m using in the site?

    Thanks

    Plugin Support tribalmike

    (@tribalmike)

    Hi, @pchenriques .

    Add this at the very top of your functions.php file (Appearance -> Theme Editor).

    if(!function_exists('tribe_is_past')){
        function tribe_is_past(){
            return false;
        }
    }

    That should fix the ‘Call to undefined function tribe_is_past()’ error.

    Mike

    Thanks @tribalmike

    It worked perfectly. No issues now while deactivating TEC plugin in the staging site.

    Thanks again

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Deactivating The Events Calendar is causing “technical difficulties”’ is closed to new replies.