Directory

✅ 🐞 3.21.2 Update throws error in icon box widget - [ED-14535] · Issue #25837 · elementor/elementor · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ 🐞 3.21.2 Update throws error in icon box widget - [ED-14535] #25837

Closed
6 tasks done
maxms opened this issue Apr 24, 2024 · 8 comments · Fixed by #25850 or #25849
Closed
6 tasks done

✅ 🐞 3.21.2 Update throws error in icon box widget - [ED-14535] #25837

maxms opened this issue Apr 24, 2024 · 8 comments · Fixed by #25850 or #25849
Assignees
Labels
bug Indicates a bug with one or multiple components. component/code Indicates when a topic is related to a component’s code. mod* solved Indicates that an Issue has been Solved, or a Feature Request has been Released. status/merged Indicates when a Pull Request has been merged to a Release. widget/icon-box References the Icon Box widget.

Comments

@maxms
Copy link

maxms commented Apr 24, 2024

Prerequisites

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

Description

The icon box widget displays with two errors above it:
"Warning: Undefined array key "icon" in .../wp-content/plugins/elementor/includes/widgets/icon-box.php on line 695"
"Warning: Undefined array key "icon" in .../wp-content/plugins/elementor/includes/widgets/icon-box.php on line 708"

Steps to reproduce

Place icon box widget. Errors show in Elementor editor and on front end.
Screenshot 2024-04-24 at 10 51 57 AM

Expected behavior

No errors

Isolating the problem

  • This bug happens when only the Elementor (and Elementor Pro) plugins are active.
  • This bug happens with the Hello Elementor theme active.
  • I can reproduce this bug consistently by following the steps I described above.

Elementor System Info

Click to reveal
== Server Environment ==
	Operating System: Linux
	Software: Apache
	MySQL version: Source distribution v8.0.35-27
	PHP Version: 8.1.27
	PHP Memory Limit: 3000M
	PHP Max Input Vars: 1000
	PHP Max Post Size: 60M
	GD Installed: Yes
	ZIP Installed: Yes
	Write Permissions: All right
	Elementor Library: Connected

== WordPress Environment ==
	Version: 6.5.2
	Site URL: https://novare.maxms-dev.com
	Home URL: https://novare.maxms-dev.com
	WP Multisite: No
	Max Upload Size: 60 MB
	Memory limit: 40M
	Max Memory limit: 3000M
	Permalink Structure: /%postname%/
	Language: en_US
	Timezone: America/Denver
	Debug Mode: Inactive

== Theme ==
	Name: Novare Medical
	Version: 2.0.0
	Author: Mary Makowsky
	Child Theme: Yes
	Parent Theme Name: Hello Elementor
	Parent Theme Version: 3.0.1
	Parent Theme Author: Elementor Team

== User ==
	Role: administrator
	WP Profile lang: en-US
	User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

== Active Plugins ==
	Duplicate Page
		Version: 4.5.3
		Author: mndpsingh287

	Elementor
		Version: 3.21.2
		Author: Elementor.com

	Elementor Pro
		Version: 3.21.1
		Author: Elementor.com

	Enable Media Replace
		Version: 4.1.5
		Author: ShortPixel

	Server-Side Cache AutoPurge
		Version: 1.0.2
		Author: Suresupport

	Yoast SEO
		Version: 22.5
		Author: Team Yoast


== Elements Usage ==
	
	container : 4
		button : 1
		container : 21
		form : 1
		heading : 6
		image : 10
		spacer : 1
		text-editor : 1
	footer : 1
		container : 6
		divider : 1
		heading : 2
		icon-box : 2
		nav-menu : 1
		text-editor : 3
		theme-site-title : 1
	header : 1
		button : 1
		container : 7
		icon-box : 2
		nav-menu : 1
		social-icons : 1
		theme-site-logo : 1
	page : 10
		accordion : 11
		button : 60
		container : 7
		counter : 8
		divider : 1
		form : 5
		google_maps : 1
		heading : 194
		icon : 14
		icon-box : 10
		icon-list : 2
		image : 59
		image-box : 48
		progress : 12
		spacer : 36
		star-rating : 2
		text-editor : 26
	section : 4
		button : 25
		counter : 9
		form : 1
		heading : 41
		icon : 7
		icon-box : 4
		image : 21
		image-box : 26
		spacer : 11
		star-rating : 1
		text-editor : 4
	wp-page : 9
		button : 28
		container : 89
		counter : 3
		form : 1
		heading : 45
		icon : 4
		icon-box : 12
		image : 9
		image-box : 4
		social-icons : 1
		spacer : 4
		testimonial-carousel : 1
		text-editor : 15
	error-404 : 1
		button : 1
		container : 1
		heading : 2
		text-editor : 1


== Settings ==
	
	cpt_support: post, page
	allow_tracking: yes
	unfiltered_files_upload: 1
	font_display: swap


== Features ==
	Custom Fonts: 0
	Custom Icons: 1

== Integrations ==
	
	recaptcha_v3: Active


== Elementor Experiments ==
	Improved Asset Loading: Active by default
	Improved CSS Loading: Active by default
	Inline Font Icons: Active by default
	Additional Custom Breakpoints: Active by default
	admin_menu_rearrangement: Inactive by default
	Flexbox Container: Active by default
	Upgrade Swiper Library: Active by default
	Grid Container: Active by default
	Nested Elements Performance: Inactive by default
	Optimized Control Loading: Active
	Default to New Theme Builder: Active by default
	Hello Theme Header & Footer: Inactive
	Elementor Home Screen: Active by default
	Editor Top Bar: Inactive by default
	Build with AI: Active by default
	Landing Pages: Active by default
	Nested Elements: Inactive by default
	Lazy Load Background Images: Active by default
	Display Conditions: Active by default
	Form Submissions: Active by default
	Menu: Inactive by default
	Taxonomy Filter: Active by default


== Log ==
	
Log: showing 20 of 332024-04-17 14:39:41 [info] Import runner completed: plugins ✓ 
2024-04-17 14:40:19 [info] Import runner completed: templates ✓ 
2024-04-17 14:41:26 [info] Import runner completed: taxonomies ✓ 
2024-04-17 14:41:27 [info] Import runner completed: elementor-content ✓ 
2024-04-17 14:41:27 [info] Import runner completed: wp-content ✓ 
2024-04-18 10:33:31 [info] elementor::elementor_updater Started 
2024-04-18 10:33:31 [info] Elementor/Upgrades - _on_each_version Start  
2024-04-18 10:33:32 [info] Elementor data updater process has been queued. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.0',
  'to' => '3.21.1',
)]
2024-04-18 10:33:34 [info] Elementor/Upgrades - _on_each_version Finished 
2024-04-18 10:33:35 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.0',
  'to' => '3.21.1',
)]
2024-04-24 10:43:57 [info] elementor-pro::elementor_pro_updater Started 
2024-04-24 10:43:57 [info] Elementor data updater process has been queued. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.1',
  'to' => '3.21.2',
)]
2024-04-24 10:43:58 [info] Elementor Pro/Upgrades - _on_each_version Start  
2024-04-24 10:43:58 [info] Elementor data updater process has been queued. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.21.0',
  'to' => '3.21.1',
)]
2024-04-24 10:43:58 [info] Elementor Pro/Upgrades - _on_each_version Finished 
2024-04-24 10:43:58 [info] elementor::elementor_updater Started 
2024-04-24 10:43:59 [info] Elementor/Upgrades - _on_each_version Start  
2024-04-24 10:43:59 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor Pro',
  'from' => '3.21.0',
  'to' => '3.21.1',
)]
2024-04-24 10:44:05 [info] Elementor/Upgrades - _on_each_version Finished 
2024-04-24 10:44:05 [info] Elementor data updater process has been completed. [array (
  'plugin' => 'Elementor',
  'from' => '3.21.1',
  'to' => '3.21.2',
)]

PHP: showing 5 of 5PHP: 2024-04-17 14:41:25 [warning X 1][../wp-content/plugins/elementor/core/base/document.php::1686] Undefined array key "thumbnail" [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2024-04-17 15:33:46 [warning X 1][../wp-content/plugins/elementor/modules/history/revisions-manager.php::363] Undefined array key "editor_post_id" [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2024-04-17 17:12:20 [warning X 48][../wp-content/plugins/elementor/includes/managers/image.php::113] Trying to access array offset on value of type bool [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2024-04-18 11:19:51 [notice X 1][../wp-content/plugins/elementor/includes/managers/image.php::102] Automatic conversion of false to array is deprecated [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2024-04-24 10:44:18 [warning X 7][../wp-content/plugins/elementor/includes/widgets/icon-box.php::708] Undefined array key "icon" [array (
  'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]

JS: showing 4 of 4JS: 2024-04-17 21:10:41 [error X 1][../wp-content/plugins/elementor/assets/js/editor.min.js?ver=3.21.0:3:1139521] Cannot read properties of null (reading 'getBoundingClientRect') 
JS: 2024-04-17 21:33:53 [error X 38][../wp-content/plugins/elementor/assets/js/editor-document.min.js?ver=3.21.0:2:4095] Cannot read properties of null (reading 'history') 
JS: 2024-04-17 22:27:53 [error X 1][../wp-admin/load-scripts.php?c=0&loadchunk_0=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.5.2:2:28760] Cannot read properties of undefined (reading 'value') 
JS: 2024-04-17 22:54:27 [error X 1][../wp-content/plugins/elementor/assets/js/editor.min.js?ver=3.21.0:3:54583] Cannot read properties of undefined (reading 'activate') 



== Elementor - Compatibility Tag ==
	
	Elementor Pro: Compatibility not specified

== Elementor Pro - Compatibility Tag ==

Agreement

  • I agree that my issue may be closed without action if it doesn't meet all the requirements.
@maxms maxms added the status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged. label Apr 24, 2024
@maxms maxms changed the title 3.21.2 Update throws error in icon widget 3.21.2 Update throws error in icon box widget Apr 24, 2024
@robbygeybels
Copy link

I fixed this by doing this:
image

` // $has_icon = ! empty( $settings['icon'] || ! empty( $settings['selected_icon']['value'] ) );
$has_icon = ! empty( $settings['icon']) || ! empty($settings ['selected_icon']['value'] ) ;
$has_content = ! Utils::is_empty( $settings['title_text'] ) || ! Utils::is_empty( $settings['description_text'] );

	if ( ! $has_icon && ! $has_content ) {
		return;
	}

	if ( $has_link ) {
		$this->add_link_attributes( 'link', $settings['link'] );
		$this->add_render_attribute( 'icon', 'tabindex', '-1' );
	}

	// if ( $has_icon ) {
	// 	$this->add_render_attribute( 'i', 'class', $settings['icon'] );
	// 	$this->add_render_attribute( 'i', 'aria-hidden', 'true' );
	// }

	if ($has_icon) {
	    if (isset($settings['icon'])) { // Ensure the 'icon' key exists
	        $this->add_render_attribute('i', 'class', $settings['icon']);
	        $this->add_render_attribute('i', 'aria-hidden', 'true');
	    } else {
	        // Optionally set a default icon class or handle the absence in another appropriate way
	        $this->add_render_attribute('i', 'class', 'default-icon-class');
	        $this->add_render_attribute('i', 'aria-hidden', 'true');
	    }
	}

`

line 695 (now commented out) = original, replaced by 2 lines under it 696-697
line 708-711= original (now commented out), and replaced by 713-722

@nguyenvuhoang
Copy link

Great!!!!!!

@kjarret
Copy link

kjarret commented Apr 25, 2024

Nice ! 👍

	// $has_icon = ! empty( $settings['icon'] || ! empty( $settings['selected_icon']['value'] ) );
	$has_icon = ! empty( $settings['icon']) || ! empty($settings ['selected_icon']['value']);
	$has_content = ! Utils::is_empty( $settings['title_text'] ) || ! Utils::is_empty( $settings['description_text'] );

	if ( ! $has_icon && ! $has_content ) {
		return;
	}

	if ( $has_link ) {
		$this->add_link_attributes( 'link', $settings['link'] );
		$this->add_render_attribute( 'icon', 'tabindex', '-1' );
	}

	// if ( $has_icon ) {
	// 	$this->add_render_attribute( 'i', 'class', $settings['icon'] );
	// 	$this->add_render_attribute( 'i', 'aria-hidden', 'true' );
	// }

	if ($has_icon) {
    if (isset($settings['icon'])) { // Ensure the 'icon' key exists
        $this->add_render_attribute('i', 'class', $settings['icon']);
        $this->add_render_attribute('i', 'aria-hidden', 'true');
    } else {
        // Optionally set a default icon class or handle the absence in another appropriate way
        $this->add_render_attribute('i', 'class', 'default-icon-class');
        $this->add_render_attribute('i', 'aria-hidden', 'true');
    }
}

@esteficodes
Copy link

Thank you so much for this! (I can see we're all up to the same)

@R17d
Copy link

R17d commented Apr 25, 2024

It helped me a lot, I managed to resolve this information, a hug from Brazil

@WildHund
Copy link

+1

@WildHund
Copy link

WildHund commented Apr 25, 2024

when can we expect an official fix? 🐛 🚲 🚑 please give me a call when you fix it

@avivu
Copy link

avivu commented Apr 25, 2024

Hi All,

This issue has been resolved in Elementor v3.21.3

Feel free to update

Thanks!

@rami-elementor rami-elementor self-assigned this Apr 25, 2024
@nicholaszein nicholaszein changed the title 3.21.2 Update throws error in icon box widget ✅ 🐞 3.21.2 Update throws error in icon box widget Apr 27, 2024
@nicholaszein nicholaszein added status/merged Indicates when a Pull Request has been merged to a Release. component/code Indicates when a topic is related to a component’s code. solved Indicates that an Issue has been Solved, or a Feature Request has been Released. widget/icon-box References the Icon Box widget. mod* bug Indicates a bug with one or multiple components. and removed status/awaiting_triage Indicates when an Issue, Pull Request, or Discussion awaits to be triaged. labels Apr 27, 2024
@elementor elementor deleted a comment from agad-alx Apr 27, 2024
@elementor elementor locked and limited conversation to collaborators Apr 27, 2024
@nicholaszein nicholaszein changed the title ✅ 🐞 3.21.2 Update throws error in icon box widget ✅ 🐞 3.21.2 Update throws error in icon box widget - [ED-14535] Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Indicates a bug with one or multiple components. component/code Indicates when a topic is related to a component’s code. mod* solved Indicates that an Issue has been Solved, or a Feature Request has been Released. status/merged Indicates when a Pull Request has been merged to a Release. widget/icon-box References the Icon Box widget.
Projects
None yet
10 participants