Skip to content

🐞 Bug report: Favourite Widget crashes Editor when Widget is deleted #17641

@ase-egr

Description

@ase-egr

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest stable version of Elementor.

Description

If you have a widget on your favourites list is removed (by disabling the plugin providing it) the whole editor crashes with

Fatal error: Uncaught Error: Call to a member function set_config() on null in /var/www/wordpress/wp-content/plugins/elementor/modules/favorites/types/widgets.php:50 Stack trace: #0 /var/www/wordpress/wp-includes/class-wp-hook.php(307): Elementor\Modules\Favorites\Types\Widgets->update_widget_categories() #1 /var/www/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()

Steps to reproduce

  • Install any Plugin that provides Widgets to Elementor (e.g. Essential Addons for Elementor, also works with a Wordpress widget)

  • Go into the page editor. Favour any widget provided
    elem_fav_bug

  • now go back to the dashboard and disable the plugin

  • when you now try to enter the elementor page editor you will receive a critical error, as the widget data for the favoured widgets list is trying to access non-existing widget data.

Isolating the problem

  • This bug happens with only Elementor plugin active (and Elementor Pro).
  • This bug happens with a Blank WordPress theme active (Hello theme).
  • I can reproduce this bug consistently using the steps above.

System Info

== Server Environment ==
Operating System: Linux
Software: nginx/1.16.1
MySQL version: MariaDB Server v10.5.9
PHP Version: 7.4.19
PHP Max Input Vars: 1000
PHP Max Post Size: 8M
GD Installed: Yes
ZIP Installed: No
Write Permissions: There are some writing permissions issues with the following directories/files:
- WordPress root directory
Elementor Library: Connected

== WordPress Environment ==
Version: 5.9
Site URL: ###
Home URL: ###
WP Multisite: No
Max Upload Size: 2 MB
Memory limit: 256M
Permalink Structure: Plain
Language: en-US
Timezone: 0
Admin Email: ###
Debug Mode: Active

== Theme ==
Name: Hello Elementor
Version: 2.5.0
Author: Elementor Team
Child Theme: No

== User ==
Role: administrator
WP Profile lang: en_US
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0

== Active Plugins ==
Elementor
Version: 3.5.4
Author: Elementor.com

== Elementor Experiments ==
Optimized DOM Output: Active by default
Improved Asset Loading: Active by default
Improved CSS Loading: Active by default
Inline Font Icons: Inactive by default
Accessibility Improvements: Active by default
Import Export Template Kit: Active by default
Additional Custom Breakpoints: Active by default
Hide native WordPress widgets from search results: Active by default
Hello Theme Header & Footer: Active by default
Landing Pages: Active by default
Color Sampler: Active by default
Favorite Widgets: Active by default
Admin Top Bar: Active by default

== Log ==

Log: showing 14 of 142021-11-22 13:11:28 [info] elementor::elementor_updater Started
2021-11-22 13:11:28 [info] Elementor/Upgrades - _on_each_version Start
2021-11-22 13:11:28 [info] Elementor/Upgrades - _on_each_version Finished
2021-11-22 13:11:28 [info] Elementor/Upgrades - _v_3_4_8_fix_font_awesome_default_value_from_1_to_yes Start
2021-11-22 13:11:28 [info] Elementor/Upgrades - _v_3_4_8_fix_font_awesome_default_value_from_1_to_yes Finished
2021-11-22 13:11:28 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor',
'from' => '3.4.4',
'to' => '3.4.8',
)]
2021-11-22 13:11:28 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor',
'from' => '3.4.4',
'to' => '3.4.8',
)]
2022-01-31 09:29:49 [info] elementor::elementor_updater Started
2022-01-31 09:29:49 [info] Elementor/Upgrades - _on_each_version Start
2022-01-31 09:29:49 [info] Elementor/Upgrades - _on_each_version Finished
2022-01-31 09:29:49 [info] Elementor/Upgrades - _v_3_5_0_remove_old_elementor_scheme Start
2022-01-31 09:29:49 [info] Elementor/Upgrades - _v_3_5_0_remove_old_elementor_scheme Finished
2022-01-31 09:29:49 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor',
'from' => '3.4.8',
'to' => '3.5.4',
)]
2022-01-31 09:29:49 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor',
'from' => '3.4.8',
'to' => '3.5.4',
)]

PHP: showing 1 of 1PHP: 2022-01-31 13:38:22 [error X 6][/var/www/wordpress/wp-content/plugins/elementor/modules/favorites/types/widgets.php::50] Uncaught Error: Call to a member function set_config() on null in /var/www/wordpress/wp-content/plugins/elementor/modules/favorites/types/widgets.php:50
Stack trace:
#0 /var/www/wordpress/wp-includes/class-wp-hook.php(307): Elementor\Modules\Favorites\Types\Widgets->update_widget_categories()
#1 /var/www/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#2 /var/www/wordpress/wp-includes/plugin.php(474): WP_Hook->do_action()
#3 /var/www/wordpress/wp-content/plugins/elementor/core/base/document.php(550): do_action()
#4 /var/www/wordpress/wp-content/plugins/elementor/includes/base/controls-stack.php(1011): Elementor\Core\Base\Document->get_initial_config()
#5 /var/www/wordpress/wp-content/plugins/elementor/core/editor/editor.php(522): Elementor\Controls_Stack->get_config()
#6 /var/www/wordpress/wp-includes/class-wp-hook.php(307): Elementor\Core\Editor\Editor->enqueue_scripts()
#7 /var/www/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#8 /var/www/wordpress/wp-includes [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]

== Elementor - Compatibility Tag ==

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates a bug with one or multiple components.editorReferences the Elementor Editor and all its components.status/has-prIndicates that an Issue, or Discussion has a companion Pull Request awaiting to be merged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions