• Resolved darthambiguous

    (@darthambiguous)


    TLDR: can’t edit any page as Elementor triggers a critical error.

    Site – [ redundant link removed ]
    Theme – Rife Child Free by https://apollo13themes.com/
    System Info – https://pastebin.com/v5KkAAEQ

    I’d originally set up with Modern Events Calendar Lite but it crippled the site with incredibly slow speed loads.

    So I installed The Events Calendar at the same time so I could ensure the site had a calendar until I swapped it over.

    It didn’t do what I wanted either so I continued searching and found Timely All-in-One Events Calendar – it does exactly what I want and is fast.

    So after setting it up I deleted the original two event plugins.

    Everything was working great up until that point. Now I can’t get Elementor to work at all. Every page I attempt to edit with Elementor gives me
    “There has been a critical error on this website. Please check your site admin email inbox for instructions.”

    I’ve used Elementor tools to Regenerate CSS & Data and Sync Library.

    I’ve installed Fresh Plugins to ensure my plugins were up-to-date
    I’ve installed Force Reinstall to ensure my theme is up-to-date (Rife Child by Apollo 13) – both of these were used to do the updates and are currently deactivated.

    I reinstalled both of the events plugins in case something was deleted when they were removed, but there’s been no change.

    I even reinstalled WooCommerce (removed over a week ago because the client is using Shopify, which means I’m using ShopWP – I’d had an issue with that but it’s working perfectly, and was doing so 12 hours before any of this mess began).

    Here’s the System Info – https://pastebin.com/v5KkAAEQ

    There were only two messages in my Console (I didn’t notice until I’d made the pastebin they were meant to be added – sorry):

    [Info] Successfully preconnected to https://fonts.gstatic.com/
    [Log] JQMIGRATE: Migrate is installed, version 3.3.2 (load-scripts.php, line 5)
    

    Other notes: I’ve read the documentation and FAQs – I’m sure I’ve brought this upon myself and created something unique. Could be wrong. Hope I’m wrong. Hope it’s easy.

    All themes, plugins, translations etc are up to date.
    Everything has been troubleshot. Deactivated in various combos.
    Purged cache every time a change was made.
    Set up Debug.

    I’ve used the “Music” page as the example, but the issue was first noticed on the “Shows” page. However I’ve swapped it for a standard WP page so the calendar can be displayed. Not pretty. But it works.

    Thanks in advance!

    • This topic was modified 2 years, 10 months ago by Jan Dembowski.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • @darthambiguous Hey there! Author of ShopWP here.

    Does the issue go away if you deactivate all your other plugins except Elementor?

    Thread Starter darthambiguous

    (@darthambiguous)

    Hi @andrewmrobbins

    Annoyingly no. I’ve tried every variant.
    Elementor on, theme on, all other plugins off.
    Elementor on, theme off, all other plugins off.
    Elementor on, theme on, an extra plugin on.
    Etc

    Thread Starter darthambiguous

    (@darthambiguous)

    Wordpress just sent this:

    `Error Details
    =============
    An error of type E_ERROR was caused in line 50 of the file /home/dh_2trbik/williamcrightonmusic.com.au/wp-content/plugins/elementor/modules/favorites/types/widgets.php. Error message: Uncaught Error: Call to a member function set_config() on null in /home/dh_2trbik/williamcrightonmusic.com.au/wp-content/plugins/elementor/modules/favorites/types/widgets.php:50
    Stack trace:
    #0 /home/dh_2trbik/williamcrightonmusic.com.au/wp-includes/class-wp-hook.php(303): Elementor\Modules\Favorites\Types\Widgets->update_widget_categories(Object(Elementor\Core\DocumentTypes\Post))
    #1 /home/dh_2trbik/williamcrightonmusic.com.au/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(”, Array)
    #2 /home/dh_2trbik/williamcrightonmusic.com.au/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
    #3 /home/dh_2trbik/williamcrightonmusic.com.au/wp-content/plugins/elementor/core/base/document.php(550): do_action(‘elementor/docum…’, Object(Elementor\Core\DocumentTypes\Post))
    #4 /home/dh_2trbik/williamcrightonmusic.com.au/wp-content/plugins/elementor/includes/base/controls-stack.php(997): Elementor\Core\Base\Document->get_initial_config()
    #5 /home/dh_2trbik/williamcrightonmusic.com.au/wp-content/plugins/elemento

    Thread Starter darthambiguous

    (@darthambiguous)

    More info.

    I’ve seen an identical question asked in the Elementor Community site, so while I’m glad it’s not just me, it’s also an issue that should be looked at.

    Could anyone at @michellei confirm if the issue is being looked at?

    ---------- Forwarded message ---------
    From: DreamHost Customer Support Team <[email protected]>
    Date: Mon, 17 Jan 2022 at 10:22 pm
    Subject: Re: Elementor plug-in is causing fatal error
    
    Hello Stephen,
    
    I was able to find the log error generated. Please try to get in touch with Elementor and refer this error to them then get back to us so that we can help you resolve this issue.
    
    [Mon Jan 17 04:19:45.723645 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: PHP
    Fatal error:  Uncaught Error: Call to a member function set_config() on
    null in
    /home/***/williamcrightonmusic.com.au/wp-content/plugins/elementor/modules/favorites/types/widgets.php:50,
    referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723787 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: Stack
    trace:, referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723810 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: #0
    /home/***/williamcrightonmusic.com.au/wp-includes/class-wp-hook.php(303):
    Elementor\\Modules\\Favorites\\Types\\Widgets->update_widget_categories(Object(Elementor\\Core\\DocumentTypes\\Post)),
    referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723841 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: #1
    /home/***/williamcrightonmusic.com.au/wp-includes/class-wp-hook.php(327):
    WP_Hook->apply_filters('', Array), referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723870 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: #2
    /home/***/williamcrightonmusic.com.au/wp-includes/plugin.php(470):
    WP_Hook->do_action(Array), referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723894 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: #3
    /home/***/williamcrightonmusic.com.au/wp-content/plugins/elementor/core/base/document.php(550):
    do_action('elementor/docum...',
    Object(Elementor\\Core\\DocumentTypes\\Post)), referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723925 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: #4
    /home/***/williamcrightonmusic.com.au/wp-content/plugins/elementor/includes/base/controls-stack.php(997):
    Elementor\\Core\\Base\\Document->get_initial_config(), referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit
    [Mon Jan 17 04:19:45.723950 2022] [fcgid:warn] [pid 284341:tid
    140632095471360] [client 130.105.135.20:60110] mod_fcgid: stderr: #5
    /home/***/williamcrightonmusic.com.au/wp-content/plugins/elemento
    in
    /home/dh_2trbik/williamcrightonmusic.com.au/wp-content/plugins/elementor/modules/favorites/types/widgets.php
    on line 50, referer:
    https://williamcrightonmusic.com.au/wp-admin/post.php?post=12646&action=edit

    @darthambiguous

    Obviously I’m not a dev at Elementor, but after a quick look the issue appears to be this chunk of code:

    
    public function update_widget_categories( $document ) {
    		foreach ( $this->values() as $favorite ) {
    			Plugin::$instance->widgets_manager->get_widget_types( $favorite )
    				->set_config( 'categories', [ static::CATEGORY_SLUG ] );
    		}
    	}
    

    The code is at the very bottom of this file: plugins/elementor/modules/favorites/types/widgets.php

    The method: get_widget_types($favorite) is returning null for some reason. This is the core problem.

    As a workaround to (potentially) fix the critical error on your site, you could change the code to this instead:

    
    public function update_widget_categories( $document ) {
    
    		foreach ( $this->values() as $favorite ) {
    			
    			$types = Plugin::$instance->widgets_manager->get_widget_types( $favorite );
    
    			if (!empty($types)) {
    				$types->set_config( 'categories', [ static::CATEGORY_SLUG ] );
    			}
    			
    		}
    		
    	}

    This checks to ensure a non-null value before calling the set_config method.

    Thread Starter darthambiguous

    (@darthambiguous)

    @andrewmrobbins you’re going above and beyond with your help. Thank you.

    Unfortunately it didn’t seem to work. Did I not copy it correctly?

    An error of type E_PARSE was caused in line 47 of the file /home/***/williamcrightonmusic.com.au/wp-content/plugins/elementor/modules/favorites/types/widgets.php. Error message: syntax error, unexpected ‘ public’ (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

    @darthambiguous No problem! Happy to help.

    Can you add the code you copied here so I can see what you have? Looks like a syntax error so it’s probably a simple fix.

    Thread Starter darthambiguous

    (@darthambiguous)

    @andrewmrobbins

    public function update_widget_categories( $document ) {
    		foreach ( $this->values() as $favorite ) {
    			$types = Plugin::$instance->widgets_manager->get_widget_types( $favorite );
    				if (!empty($types)) {
    					$types->set_config( 'categories', [ static::CATEGORY_SLUG ] );
    			}
    		}
    	}

    @darthambiguous Hmm that looks right to me. One final check, can you send me the function / chunk of code right above that one?

    It looks like it’s complaining about the public keyword, which might indicate a syntax error right above it.

    Thread Starter darthambiguous

    (@darthambiguous)

    Hi @andrewmrobbins I hope they give you a commission for this!

    <?php
    namespace Elementor\Modules\Favorites\Types;
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    
    use Elementor\Modules\Favorites\Favorites_Type;
    use Elementor\Plugin;
    
    class Widgets extends Favorites_Type {
    	const CATEGORY_SLUG = 'favorites';
    
    	/**
    	 * Widgets favorites type constructor.
    	 */
    	public function __construct( array $items = [] ) {
    		parent::__construct( $items );
    
    		add_action( 'elementor/document/before_get_config', [ $this, 'update_widget_categories' ], 10, 1 );
    	}
    
    	public function get_name() {
    		return 'widgets';
    	}
    
    	public function prepare( $favorites ) {
    		return array_intersect( parent::prepare( $favorites ), $this->get_available() );
    	}
    
    	/**
    	 * Get all available widgets.
    	 *
    	 * @return string[]
    	 */
    	public function get_available() {
    		return (array) array_keys(
    			Plugin::instance()->widgets_manager->get_widget_types()
    		);
    	}
    
    	/**
    	 * Update the categories of a widget inside a filter.
    	 *
    	 * @param $document
    	 */
    	public function update_widget_categories( $document ) {
    		foreach ( $this->values() as $favorite ) {
    			Plugin::$instance->widgets_manager->get_widget_types( $favorite )
    				->set_config( 'categories', [ static::CATEGORY_SLUG ] );
    		}
    	}
    }
    Thread Starter darthambiguous

    (@darthambiguous)

    Someone just posted the fix on the Elementor Community forum.

    It’s as simple as switching the Ongoing Experiments Favorite Widgets from ‘default’ to ‘inactive’.

    Elementor -> Settings -> Experiments – > Ongoing Experiments -> Favorite Widgets

    Thank you for all your help @andrewmrobbins – it’s greatly appreciated.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Critical Error – recently removed multiple plugins’ is closed to new replies.