elementor / elementor

The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design.
https://elementor.com/
GNU General Public License v3.0
6.45k stars 1.4k forks source link

🐞 🐘 Featured image throws a warning if a post in the loop grid does not contain a feature image when using PHP 8.2 #25491

Open lucazdj opened 2 months ago

lucazdj commented 2 months ago

Prerequisites

Description

I am using a loop grid of posts in a page, and I use a image with a dynamic tag Post Featured Image. When the post has a featured image it works normally, but when the post does not have a featured image this message appears:

Warning: Trying to access array offset on value of type bool in ...\wp-content\plugins\elementor-pro\modules\dynamic-tags\tags\post-featured-image.php on line 39

Even when I choose a fallback image, the fallback does not appears, the error is still the same.

Steps to reproduce

Expected behavior

In the loop grid, when a post has a featured image, it is showed normally, but when it does not, this error is shown:

Warning: Trying to access array offset on value of type bool in ...\wp-content\plugins\elementor-pro\modules\dynamic-tags\tags\post-featured-image.php on line 39

Isolating the problem

Elementor System Info

Click to reveal ````txt == Server Environment == Operating System: WINNT Software: Apache/2.4.54 (Win64) OpenSSL/1.1.1g mod_fcgid/2.3.10-dev MySQL version: MySQL Community Server - GPL v8.0.32 PHP Version: 8.2.15 PHP Memory Limit: 1024M PHP Max Input Vars: 1000 PHP Max Post Size: 2G GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected == WordPress Environment == Version: 6.4.3 Site URL: http://localhost/project Home URL: http://localhost/project WP Multisite: No Max Upload Size: 2 GB Memory limit: 768M Max Memory limit: 1024M Permalink Structure: /%postname%/ Language: pt_BR Timezone: America/Manaus Debug Mode: Inactive == Theme == Name: Project Version: 1.0.0 Author: lucas.rocha 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: pt-BR User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 OPR/108.0.0.0 == Active Plugins == Advanced Access Manager Version: 6.9.23 Author: AAM Dynamic.ooo - Dynamic Content for Elementor Version: 2.13.5 Author: Dynamic.ooo Elementor Version: 3.20.2 Author: Elementor.com Elementor Pro Version: 3.20.1 Author: Elementor.com Element Pack Pro Version: 7.10.0 Author: BdThemes JetSearch Version: 3.3.1 Author: Crocoblock JetSmartFilters Version: 3.4.2 Author: Crocoblock Material Design Icons for Page Builders Version: 1.5.1 Author: Photon WP One Click Accessibility Version: 2.1.0 Author: One Click Accessibility Safe SVG Version: 2.2.3 Author: 10up WordPress Importer Version: 0.8.2 Author: wordpressdotorg WP Import Export Lite Version: 3.9.27 Author: VJInfotech WP Migrate Lite Version: 2.6.10 Author: WP Engine Yoast SEO Version: 22.3 Author: Team Yoast == Must-Use Plugins == WP Migrate Lite Compatibility Version: 1.3 Author: Delicious Brains == Features == Custom Fonts: 0 Custom Icons: 0 == Integrations == == Experimentos do Elementor == Carregamento de ativos melhorado: Ativo Carregamento de CSS melhorado: Ativo Ícones de fontes em linha: Ativo Pontos de interrupção personalizados adicionais: Ativo admin_menu_rearrangement: Inativo por padrão Contêiner Flexbox: Ativo Atualizar a biblioteca Swiper: Ativo Contêiner de grade: Ativo Default to New Theme Builder: Ativo Tema Hello - Cabeçalho & Rodapé: Ativo Barra superior do editor: Ativo Carregamento otimizado do Gutenberg: Ativo Construa com IA: Ativo Páginas de destino: Ativo Elementos aninhados: Ativo Imagens de fundo com carregamento lento: Ativo Otimizar o carregamento de imagens: Ativo Painel de páginas: Inativo por padrão Notes: Ativo Display Conditions: Inativo Form Submissions: Ativo Menu: Ativo Taxonomy Filter: Ativo == Registro == PHP: showing 6 of 6PHP: 2024-03-07 11:41:18 [warning X 2][..\wp-content\plugins\elementor-pro\core\app\modules\site-editor\data\endpoints\templates.php::150] Undefined array key "condition_type" [array ( 'trace' => ' #0: ..\wp-content\plugins\elementor-pro\core\app\modules\site-editor\data\endpoints\templates.php(150): Elementor\Core\Logger\Manager -> rest_error_handler() #1: ..\wp-content\plugins\elementor-pro\core\app\modules\site-editor\data\endpoints\templates.php(83): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> normalize_template_json_item() #2: ..\wp-content\plugins\elementor\data\base\endpoint.php(166): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates -> update_item() #3: ..\wp-content\plugins\elementor\data\base\endpoint.php(307): Elementor\Data\Base\Endpoint -> base_callback() #4: ..\wp-includes\rest-api\class-wp-rest-server.php(1193): Elementor\Data\Base\Endpoint -> Elementor\Data\Base\{closure}() ', )] PHP: 2024-03-08 13:20:42 [notice X 28][..\wp-content\plugins\elementor-pro\modules\screenshots\module.php::33] Function utf8_decode() is deprecated [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2024-03-15 11:26:25 [notice X 30][..\wp-content\plugins\elementor\includes\base\controls-stack.php::228] hexdec(): Passing null to parameter #1 ($hex_string) of type string is deprecated [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2024-03-19 10:20:26 [warning X 2][..\wp-content\plugins\elementor\core\kits\manager.php::280] Attempt to read property "post_status" on null [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2024-03-20 17:04:10 [warning X 3][..\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-03-21 09:28:17 [warning X 2][..\wp-content\plugins\elementor-pro\modules\dynamic-tags\tags\post-featured-image.php::39] Trying to access array offset on value of type bool [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] JS: showing 9 of 9JS: 2024-03-07 17:14:10 [error X 2][../wp-content/plugins/elementor/assets/js/frontend-modules.min.js?ver=3.19.4:2:11798] Cannot read properties of undefined (reading 'params') JS: 2024-03-07 17:25:10 [error X 8][../wp-content/plugins/elementor/assets/js/frontend-modules.min.js?ver=3.19.4:2:10613] Cannot read properties of undefined (reading 'autoplay') JS: 2024-03-07 17:29:37 [error X 12][../wp-includes/js/jquery/jquery.min.js?ver=3.7.1:2:28760] Cannot read properties of undefined (reading 'value') JS: 2024-03-08 15:34:21 [error X 1][../wp-content/plugins/elementor/assets/lib/backbone/backbone.marionette.min.js?ver=2.4.5.e1:24:19952] View (cid: "view59913") has already been destroyed and cannot be used. JS: 2024-03-08 15:34:26 [error X 1][../wp-content/plugins/elementor/assets/lib/backbone/backbone.marionette.min.js?ver=2.4.5.e1:24:19952] View (cid: "view66368") has already been destroyed and cannot be used. JS: 2024-03-08 20:32:00 [error X 1][../wp-content/plugins/elementor/assets/lib/backbone/backbone.marionette.min.js?ver=2.4.5.e1:24:19952] View (cid: "view4081") has already been destroyed and cannot be used. JS: 2024-03-11 14:17:27 [error X 1][../wp-content/plugins/elementor/assets/js/editor.min.js?ver=3.19.4:3:609199] Cannot read properties of null (reading 'id') JS: 2024-03-11 20:13:57 [error X 1][https://localhost/project/wp-content/plugins/elementor/assets/lib/backbone/backbone.marionette.min.js?ver=2.4.5.e1:24:19952] View (cid: "view80165") has already been destroyed and cannot be used. JS: 2024-03-12 15:45:59 [error X 13][../wp-content/plugins/elementor/assets/js/editor-modules.min.js?ver=3.20.0:3:16087] Cannot read properties of undefined (reading 'global') Log: showing 20 of 272024-03-12 10:52:11 [info] elementor::elementor_updater Started 2024-03-12 10:52:11 [info] Elementor/Upgrades - _on_each_version Start 2024-03-12 10:52:12 [info] Elementor/Upgrades - _on_each_version Finished 2024-03-12 10:52:12 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.19.4', 'to' => '3.20.0', )] 2024-03-13 09:00:02 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Dynamic.ooo - Dynamic Content for Elementor', 'from' => '2.13.4', 'to' => '2.13.5', )] 2024-03-15 11:17:32 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.20.0', 'to' => '3.20.1', )] 2024-03-15 11:17:33 [info] elementor::elementor_updater Started 2024-03-15 11:17:34 [info] Elementor/Upgrades - _on_each_version Start 2024-03-15 11:17:34 [info] Elementor/Upgrades - _on_each_version Finished 2024-03-15 11:17:34 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.20.0', 'to' => '3.20.1', )] 2024-03-21 09:22:52 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.20.1', 'to' => '3.20.2', )] 2024-03-21 09:22:53 [info] elementor::elementor_updater Started 2024-03-21 09:22:53 [info] Elementor/Upgrades - _on_each_version Start 2024-03-21 09:22:53 [info] Elementor/Upgrades - _on_each_version Finished 2024-03-21 09:22:53 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.20.1', 'to' => '3.20.2', )] 2024-03-21 09:23:54 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor Pro', 'from' => '3.20.0', 'to' => '3.20.1', )] 2024-03-21 09:23:55 [info] elementor-pro::elementor_pro_updater Started 2024-03-21 09:23:55 [info] Elementor Pro/Upgrades - _on_each_version Start 2024-03-21 09:23:55 [info] Elementor Pro/Upgrades - _on_each_version Finished 2024-03-21 09:23:55 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '3.20.0', 'to' => '3.20.1', )] == Elementor - Compatibility Tag == Dynamic.ooo - Dynamic Content for Elementor: Compatibilidade não especificada Elementor Pro: Compatibilidade não especificada == Elementor Pro - Compatibility Tag == ````

Agreement

nicholaszein commented 2 months ago

Hello @lucazdj!

Thank you for submitting your issue! 🙏

🏷️ We've labeled this issue and our team will take a look at it. If there is indeed a problem, they'll work on fixing it. We can't say exactly when it'll be sorted out, but we kindly ask for your patience. Thanks for understanding!

As a workaround, we suggest you to either set WP_DEBUG_DISPLAY to false in your wp-config.php file, or switch to PHP 8.0 or 7.4, as this looks like a warning caused by PHP 8.2.


if ( ! defined( 'WP_DEBUG_DISPLAY' ) {
    define( 'WP_DEBUG_DISPLAY', false );
}

Add the code above to your wp-config.php file located in the root folder of your WordPress installation, right above the line with the comment that says /* That's all, stop editing! Happy publishing. */.

Best regards