-
Notifications
You must be signed in to change notification settings - Fork 1.5k
❌ 🔗 Elementor AI module: Call to a member function get_gallery_image_ids() on bool #35388
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
duplicateIndicates when an Issue or a Discussion is a duplicate of another Issue or Discussion.Indicates when an Issue or a Discussion is a duplicate of another Issue or Discussion.integration/woocommerceReferences any component related to Elementor Pro’s WooCommerce Builder.References any component related to Elementor Pro’s WooCommerce Builder.mod*[Temp.] For internal use only.[Temp.] For internal use only.mod/b*[Temp.] For internal use only.[Temp.] For internal use only.mod/d*[Temp.] For internal use only.[Temp.] For internal use only.product/aiReferences any component related to the Elementor AI (Artificial Intelligence) product.References any component related to the Elementor AI (Artificial Intelligence) product.product/proIndicates if the referenced component is part of the Elementor Pro plugin.Indicates if the referenced component is part of the Elementor Pro plugin.widget/pro/wc/product/imagesReferences the WooCommerce Product Images widget (Pro), often referred as the Product Gallery.References the WooCommerce Product Images widget (Pro), often referred as the Product Gallery.
Metadata
Metadata
Assignees
Labels
duplicateIndicates when an Issue or a Discussion is a duplicate of another Issue or Discussion.Indicates when an Issue or a Discussion is a duplicate of another Issue or Discussion.integration/woocommerceReferences any component related to Elementor Pro’s WooCommerce Builder.References any component related to Elementor Pro’s WooCommerce Builder.mod*[Temp.] For internal use only.[Temp.] For internal use only.mod/b*[Temp.] For internal use only.[Temp.] For internal use only.mod/d*[Temp.] For internal use only.[Temp.] For internal use only.product/aiReferences any component related to the Elementor AI (Artificial Intelligence) product.References any component related to the Elementor AI (Artificial Intelligence) product.product/proIndicates if the referenced component is part of the Elementor Pro plugin.Indicates if the referenced component is part of the Elementor Pro plugin.widget/pro/wc/product/imagesReferences the WooCommerce Product Images widget (Pro), often referred as the Product Gallery.References the WooCommerce Product Images widget (Pro), often referred as the Product Gallery.
Description
Bug in Elementor AI module on WooCommerce 'Add New Product' page. The AJAX action elementor-ai-get-product-images sends an empty string [""] as post_ids because the product is not saved yet. In module.php (line 351), wc_get_product("") returns false, leading to Uncaught Exception: Call to a member function get_gallery_image_ids() on bool. A simple if ( $product instanceof \WC_Product ) check is missing.
Steps to reproduce
Steps to reproduce:
Make sure WooCommerce and Elementor (with Elementor AI features enabled) are installed and active.
Go to your WordPress Admin dashboard.
Navigate to Products > Add New (which opens the /wp-admin/post-new.php?post_type=product URL). Do NOT save the product yet.
Open the browser's Developer Tools (F12) and go to the Network tab, or simply monitor your server's PHP error log (debug.log).
Notice that an automatic AJAX POST request is made to admin-ajax.php with the action: elementor-ai-get-product-images.
Check the payload of this request. Since the product is completely new and has no ID yet, it sends an empty string in the array: "post_ids": [""].
Expected behavior
The Elementor AI module should handle empty or invalid product IDs gracefully without causing a PHP Fatal Error.
Elementor System Info
Agreement