• Resolved mbratch

    (@mbratch)


    Hello

    I know this error or something similar has been posted before, but I have not found a solution in those posts.

    Our website was working fine up until very recently and now just fails with: “There has been a critical error on the website”. I have been pulling my hair out trying to fix it. I am a volunteer for a non-profit and have little experience with WordPress or Elementor. I’ve been learning as I go…

    If I go into the site as admin and try to view a page using Elementor, I get the following error:

    Uncaught Error: Class 'Elementor\Scheme_Color' not found in /var/www/wp-content/plugins/navmenu-addon-for-elementor/modules/branding/widgets/elementor-branding.php:108
    Stack trace:
    #0 /var/www/wp-content/plugins/elementor/includes/base/controls-stack.php(2313): ElementorMenus\Modules\Branding\Widgets\Elementor_Branding->_register_controls()
    #1 /var/www/wp-content/plugins/elementor/includes/base/controls-stack.php(496): Elementor\Controls_Stack->init_controls()
    #2 /var/www/wp-content/plugins/elementor/includes/base/widget-base.php(177): Elementor\Controls_Stack->get_stack()
    #3 /var/www/wp-content/plugins/elementor/includes/base/controls-stack.php(300): Elementor\Widget_Base->get_stack()
    #4 /var/www/wp-content/plugins/elementor/includes/base/controls-stack.php(2402): Elementor\Controls_Stack->get_controls()
    #5 /var/www/wp-content/plugins/elementor/includes/base/controls-stack.php(1107): Elementor\Controls_Stack->sanitize_settings(Array)
    #6 /var/www/wp-content/plugins/elementor/includes/base/controls-stack.php

    After a bunch of searching, and found a solution which involves hand-editing a couple of the php files to replace the class specifiers as follows:

    Scheme_Color::... --> \Elementor\Core\Schemes\Color::...
    Scheme_Typography::... --> \Elementor\Core\Schemes\Typography::...

    So this gets rid of the problem, but I’m concerned about the hand-editing being a bit of a hack. I’m using NavMenu add-on version 1.1.6. When I click on the link to “Visit plugin site”, that site doesn’t have any mention of this add-on. Additionally, there are no links or notification in WordPress or Elementor indicating that an update is available or needed.

    Any suggestions on a “proper” way of solving this issue (versus the hack), or is this the only option?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    `To troubleshoot this issue, follow these instructions:

    If you’re locked out of your WordPress dashboard, open the recovery email sent to you from WordPress. Click the link in that email to gain access to your site’s WordPress dashboard once again.

    Deactivate all plugins apart from Elementor. If this helps, reactivate them one by one to find the culprit.

    If this doesn’t work, switch your theme temporarily to the Hello theme and see if that helps.

    If this doesn’t work, make sure to always use the updated versions of Elementor.

    If this doesn’t work, make sure your WordPress site meets the basic requirements recommended for Elementor. You can check this in your WP Dashboard > Elementor > System Info. If needed, you can ask your hosting provider to make these changes for you.

    Learn more here:
    https://elementor.com/help/fatal-error-after-updating-or-installing-elementor-or-elementor-pro/

    There are HUNDREDS of posts online where this issue pops up.

    Elementor clearly needs to add a fix of their own. Quite simply, add a check for Elementor\Scheme_Color that then points it to Core\Schemes\Color.

    Sure, various themes and plugins might be trying to use the old code, but we can’t all sit around and wait for them to update their individual code. Elementor adding this one fix would make hundreds if not thousands of customers happy and prevent their websites from going down.

    Hey @severisth where did you add the check for elementor/scheme_color?

    I mean, in which section of the page or wordpress administration? thanks

    goodmuyis

    (@goodmuyis)

    @mcantip

    You can do that by creating a plugin in wp-content/mu-plugins/

    1. Create a new .php file in the wp-content/mu-plugins folder
    2. Add this code snippet below to the file you just created
    <?php
    /**
     * Plugin Name: Elementor Scheme_Color and Scheme_Typography Class Issue
     **/
    
    namespace Elementor;
    
    \add_action(
      'plugins_loaded',
      function() {
        if ( ! class_exists( 'Elementor\Scheme_Color' ) ) {
          class Scheme_Color extends Core\Schemes\Color {}
        }
      }
    );
    \add_action(
      'plugins_loaded',
      function() {
        if ( ! class_exists( 'Elementor\Scheme_Typography' ) ) {
          class Scheme_Typography extends Core\Schemes\Typography {}
        }
      }
    );

    This should solve the problem

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Class ‘Elementor\Scheme_Color’ not found’ is closed to new replies.