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.5k stars 1.4k forks source link

🐞 Bug report: Custom code can't save Conditions #18382

Open smickys opened 2 years ago

smickys commented 2 years ago

Prerequisites

Description

When I want to publish custom code post, a window pops up to select conditions, after I select and hit save, nothing happens.

here is an error message from console Response {type: 'basic', url: 'https://shop.dvaraka.lt/wp-json/elementor/v1/site-editor/templates-conditions/1863', redirected: false, status: 405, ok: false, …} body: (...) bodyUsed: false headers: Headers {} ok: false redirected: false status: 405 statusText: "" type: "basic" url: "https://shop.dvaraka.lt/wp-json/elementor/v1/site-editor/templates-conditions/1863"

Steps to reproduce

create a custom code

Isolating the problem

System Info

== Server Environment == Operating System: Linux Software: nginx/1.18.0 MySQL version: (Ubuntu) v8.0.28 PHP Version: 7.4.3 PHP Memory Limit: 512M PHP Max Input Vars: 5000 PHP Max Post Size: 512M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected

== WordPress Environment == Version: 5.9.3 Site URL: https://shop.dvaraka.lt Home URL: https://shop.dvaraka.lt WP Multisite: No Max Upload Size: 512 MB Memory limit: 256M Max Memory limit: 512M Permalink Structure: /%year%/%monthnum%/%day%/%postname%/ Language: lt-LT Timezone: 0 Admin Email: simonas@dvaraka.lt Debug Mode: Active

== Theme == Name: GeneratePress Version: 3.1.3 Author: Tom Usborne Child Theme: No

== User == Role: administrator WP Profile lang: lt_LT User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36

== Active Plugins == annasta Woocommerce Product Filters Version: 1.5.0 Author: annasta.net

Delivery & Pickup Date Time for WooCommerce
    Version: 1.3.28
    Author: CodeRockz

EAN for WooCommerce
    Version: 3.7.2
    Author: WPFactory

Elementor
    Version: 3.6.2
    Author: Elementor.com

Elementor Pro
    Version: 3.6.4
    Author: Elementor.com

FiboSearch - AJAX Search for WooCommerce
    Version: 1.17.0
    Author: FiboSearch Team

Flexible Shipping
    Version: 4.11.4
    Author: WP Desk

GDPR Cookie Consent
    Version: 2.1.1
    Author: WebToffee

MailerLite - Signup forms (official)
    Version: 1.5.3
    Author: MailerLite

MailerLite - WooCommerce integration
    Version: 1.6.4
    Author: MailerLite

Mail Integration for Office 365/Outlook
    Version: 1.8.6
    Author: Edward Cross

Minimum and Maximum Quantity for WooCommerce
    Version: 1.0.6
    Author: theDotstore

Omniva shipping
    Version: 1.10.0
    Author: Omniva

Perfect Brands for WooCommerce
    Version: 2.0.7
    Author: QuadLayers

Point of Sale POS for WooCommerce
    Version: 2.2.2
    Author: BizSwoop a CPF Concepts, LLC Brand

Variation Swatches for WooCommerce
    Version: 1.1.19
    Author: Emran Ahmed

WooCommerce
    Version: 6.3.1
    Author: Automattic

WooCommerce Gateway - kevin.
    Version: 2.2.0
    Author: kevin.

WooCommerce PDF Invoices & Packing Slips
    Version: 2.14.0
    Author: WP Overnight

WooCommerce PDF Invoices & Packing Slips + mPDF
    Version: 2.3.0
    Author: Ewout Fernhout

WooCommerce Product Fees
    Version: 1.3.0
    Author: Caleb Burks

WPC Composite Products for WooCommerce
    Version: 4.1.4
    Author: WPClever

Yoast SEO
    Version: 18.5.1
    Author: Team Yoast

== Must-Use Plugins == Autoloader Version: 1.2.1 Author: LittleBizzy

XXX Common
    Version: 0.0.0
    Author: SlickStack

== 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 : Inactive by default Flexbox Container: Inactive by default Default to New Theme Builder: Active by default Landing Pages: Active by default Color Sampler: Active by default Favorite Widgets: Active by default Admin Top Bar: Active by default Page Transitions: Active by default Form Submissions: Active by default Scroll Snap: Active by default

== Log ==

PHP: showing 10 of 10PHP: 2022-02-01 18:36:28 [error X 1][/var/www/html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php::160] Uncaught Error: Call to a member function get_location() on bool in /var/www/html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php:160 Stack trace:

0 /var/www/html/wp-content/plugins/elementor-pro/core/app/modules/site-editor/data/endpoints/templates-conditions-conflicts.php(25): ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->get_conditions_conflicts()

1 /var/www/html/wp-content/plugins/elementor/data/base/endpoint.php(158): ElementorPro\Core\App\Modules\SiteEditor\Data\Endpoints\Templates_Conditions_Conflicts->get_items()

2 /var/www/html/wp-content/plugins/elementor/data/base/endpoint.php(320): Elementor\Data\Base\Endpoint->base_callback()

3 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1141): Elementor\Data\Base\Endpoint->Elementor\Data\Base{closure}()

4 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(988): WP_REST_Server->respond_to_request()

5 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(414): WP_REST_Serve [array (

'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-01 18:46:41 [notice X 1][/var/www/html/wp-content/plugins/elementor-pro/modules/woocommerce/widgets/add-to-cart.php::143] Undefined index: post_id [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-02 04:19:16 [notice X 3][/var/www/html/wp-content/plugins/elementor/modules/dev-tools/deprecation.php::301] The Plugin::$instance->posts_css_manager argument is deprecated since version 2.7.0! Use Plugin::$instance->files_manager instead. [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-02 07:31:06 [notice X 1][/var/www/html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php::167] Undefined index: editor_post_id [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-02 08:30:47 [error X 1][/var/www/html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php::286] Uncaught Error: Call to a member function update_meta() on bool in /var/www/html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php:286 Stack trace:

0 /var/www/html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php(167): ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->save_conditions()

1 [internal function]: ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->ajax_save_theme_template_conditions()

2 /var/www/html/wp-content/plugins/elementor/core/common/modules/ajax/module.php(171): call_user_func()

3 /var/www/html/wp-includes/class-wp-hook.php(307): Elementor\Core\Common\Modules\Ajax\Module->handle_ajax_request()

4 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()

5 /var/www/html/wp-includes/plugin.php(474): WP_Hook->do_action()

6 /var/www/html/wp-admin/admin-ajax.php(187): do_action()

7 {main}

thrown [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-02 12:52:12 [warning X 60][/var/www/html/wp-content/plugins/elementor-pro/modules/forms/submissions/database/query.php::233] gmdate() expects parameter 2 to be int, float given [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-03 05:48:29 [warning X 2][/var/www/html/wp-content/plugins/elementor-pro/modules/assets-manager/asset-types/icons/custom-icons.php::180] unlink(Lelija_icon.svg): No such file or directory [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-10 08:31:10 [notice X 6][/var/www/html/wp-content/plugins/elementor-pro/license/updater.php::83] Undefined index: new_version [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-02-16 08:20:41 [warning X 1][/var/www/html/wp-content/plugins/elementor-pro/license/api.php::370] in_array() expects parameter 2 to be array, null given [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )] PHP: 2022-04-01 09:29:59 [notice X 1][/var/www/html/wp-content/plugins/elementor/core/experiments/experiments-reporter.php::89] Undefined index: title [array ( 'trace' => '

0: Elementor\Core\Logger\Manager -> shutdown()

', )]

JS: showing 3 of 3JS: 2022-02-02 06:42:08 [error X 3][https://shop.dvaraka.lt/wp-content/plugins/elementor/assets/js/frontend-modules.min.js?ver=3.5.4:2:5069] Cannot read properties of undefined (reading \'attributes\') JS: 2022-02-02 07:25:58 [error X 4][https://shop.dvaraka.lt/wp-content/plugins/elementor/assets/js/editor.min.js?ver=3.5.4:2:252935] Cannot read properties of undefined (reading \'html\') JS: 2022-02-02 08:32:22 [error X 3][https://shop.dvaraka.lt/wp-content/plugins/elementor/assets/js/editor.min.js?ver=3.5.4:2:453832] Cannot read properties of null (reading \'getBoundingClientRect\')

Log: showing 20 of 302022-03-02 19:37:54 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.5.5', 'to' => '3.5.6', )] 2022-03-02 19:37:54 [info] elementor::elementor_updater Started 2022-03-02 19:37:54 [info] Elementor/Upgrades - _on_each_version Start
2022-03-02 19:37:54 [info] Elementor/Upgrades - _on_each_version Finished 2022-03-02 19:37:54 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.5.5', 'to' => '3.5.6', )] 2022-03-21 15:02:53 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor Pro', 'from' => '3.6.0', 'to' => '3.6.4', )] 2022-03-21 15:02:53 [info] elementor-pro::elementor_pro_updater Started 2022-03-21 15:02:53 [info] Elementor Pro/Upgrades - _on_each_version Start
2022-03-21 15:02:53 [info] Elementor Pro/Upgrades - _on_each_version Finished 2022-03-21 15:02:53 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '3.6.0', 'to' => '3.6.4', )] 2022-03-29 11:33:04 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.5.6', 'to' => '3.6.1', )] 2022-03-29 11:33:04 [info] elementor::elementor_updater Started 2022-03-29 11:33:04 [info] Elementor/Upgrades - _on_each_version Start
2022-03-29 11:33:04 [info] Elementor/Upgrades - _on_each_version Finished 2022-03-29 11:33:04 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.5.6', 'to' => '3.6.1', )] 2022-04-07 05:40:25 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.6.1', 'to' => '3.6.2', )] 2022-04-07 05:40:25 [info] elementor::elementor_updater Started 2022-04-07 05:40:25 [info] Elementor/Upgrades - _on_each_version Start
2022-04-07 05:40:25 [info] Elementor/Upgrades - _on_each_version Finished 2022-04-07 05:40:25 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.6.1', 'to' => '3.6.2', )]

== Elementor - Compatibility Tag ==

Elementor Pro: Compatibility not specified

== Elementor Pro - Compatibility Tag ==

barkoig commented 2 years ago

I solved this problem by deactivating the All In One WordPress Security plugin. After deactivating - custom code conditions works well. I think this is because the AIWOPS plugin blocks REST API access for unauthorized requests. (WordPress 6.0, Elementor 3.6.5, Elementor pro 3.7.1, PHP 8.1.0, Hello Elementor theme + child theme)