elementor / elementor/elementor

🐞 Bug Report: Preview issue for Templates

Open
#21,079 0 comments 0 reactions 0 assignees View on GitHub
bug documents editor mod/b* product/pro theme-builder
Dominant language
PHP
Stars
7.1k
Forks
1.6k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

### Prerequisites

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

### Description

When trying to preview the 'Archive' template, the save_builder action happens, it calls the Documents_Manager class 'ajax_save' method, which then calls the Document class 'save' method, in it checks if the user can edit that post (document.php:707 '$this->is_editable_by_current_user()'). In that method it calls User class 'is_current_user_can_edit' and gives it argument which is the post_id ( $this->get_main_id() ), while debugging, for some reason for 'Archive' templates the 'get_main_id()' returns the id of 'revision', not the 'elementor_library', which is I think the issue why the 'is_current_user_can_edit' returns false and save method fails.

### Steps to reproduce

1) Make an post archive template
2) Edit and save it
3) Go back to the template edit
4) Make some changes and preview it
5) Nothing changed in the preview

### Isolating the problem

- [X] This bug happens with only Elementor plugin active (and Elementor Pro).
- [ ] This bug happens with a Blank WordPress theme active ([Hello theme](https://wordpress.org/themes/hello-elementor/)).
- [X] I can reproduce this bug consistently using the steps above.

### System Info


== Server Environment ==
Operating System: Linux
Software: nginx/1.18.0
MySQL version: mariadb.org binary distribution v10.6.11
PHP Version: 8.1.14
PHP Memory Limit: 512M
PHP Max Input Vars: 10000
PHP Max Post Size: 2G
GD Installed: Yes
ZIP Installed: Yes
Write Permissions: All right
Elementor Library: Connected

== WordPress Environment ==
Version: 6.1.1
WP Multisite: No
Max Upload Size: 1 GB
Memory limit: 40M
Max Memory limit: 512M
Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
Language: en-US
Timezone: 0
Debug Mode: Inactive

== Theme ==
Name: Twenty Twenty-Two
Version: 1.1
Author: the WordPress team
Child Theme: No

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

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

Elementor Pro
Version: 3.10.2
Author: Elementor.com

== Elements Usage ==

archive : 1
text-editor : 2
wp-page : 1
text-editor : 1

== Settings ==

allow_tracking: yes

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

== Integrations ==

== 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
Additional Custom Breakpoints: Active by default
Hide native WordPress widgets from search results: Active by default
admin_menu_rearrangement: Inactive by default
Flexbox Container: Inactive by default
Default to New Theme Builder: Active by default
Landing Pages: Active by default
Nested Elements: Inactive by default
Lazy Load Background Images: Inactive by default
Save as Default: Active by default
Page Transitions: Active by default
Notes: Active by default
Loop: Inactive by default
Form Submissions: Active by default
Scroll Snap: Active by default

== Log ==

Log: showing 19 of 192022-04-25 09:06:50 [info] elementor-pro::elementor_pro_updater Started
2022-04-25 09:06:50 [info] Elementor Pro/Upgrades - _on_each_version Start
2022-04-25 09:06:50 [info] Elementor Pro/Upgrades - _on_each_version Finished
2022-04-25 09:06:50 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor Pro',
'from' => '3.6.4',
'to' => '3.6.5',
)]
2022-04-25 09:06:50 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor Pro',
'from' => '3.6.4',
'to' => '3.6.5',
)]
2023-01-20 11:40:00 [info] elementor::elementor_updater Started
2023-01-20 11:40:00 [info] Elementor/Upgrades - _on_each_version Start
2023-01-20 11:40:00 [info] Elementor/Upgrades - _on_each_version Finished
2023-01-20 11:40:00 [info] Elementor/Upgrades - _v_3_8_0_fix_php8_image_custom_size Start
2023-01-20 11:40:00 [info] Elementor/Upgrades - _v_3_8_0_fix_php8_image_custom_size Finished
2023-01-20 11:40:00 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor',
'from' => '3.6.4',
'to' => '3.10.1',
)]
2023-01-20 11:40:00 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor',
'from' => '3.6.4',
'to' => '3.10.1',
)]
2023-01-20 11:40:06 [info] elementor-pro::elementor_pro_updater Started
2023-01-20 11:40:06 [info] Elementor Pro/Upgrades - _on_each_version Start
2023-01-20 11:40:06 [info] Elementor Pro/Upgrades - _on_each_version Finished
2023-01-20 11:40:06 [info] Elementor Pro/Upgrades - _v_3_7_2_woocommerce_rename_related_to_related_products Start
2023-01-20 11:40:06 [info] Elementor Pro/Upgrades - _v_3_7_2_woocommerce_rename_related_to_related_products Finished
2023-01-20 11:40:06 [info] Elementor data updater process has been completed. [array (
'plugin' => 'Elementor Pro',
'from' => '3.6.5',
'to' => '3.10.2',
)]
2023-01-20 11:40:06 [info] Elementor data updater process has been queued. [array (
'plugin' => 'Elementor Pro',
'from' => '3.6.5',
'to' => '3.10.2',
)]

PHP: showing 3 of 3PHP: 2023-01-20 11:39:30 [warning X 1][/web/wp/****/wp-content/plugins/elementor/core/experiments/experiments-reporter.php::89] Undefined array key "title" [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-01-20 11:40:06 [notice X 8][/web/wp/****/wp-content/plugins/elementor-pro/core/utils/collection.php::75] Return type of ElementorPro\Core\Utils\Collection::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [array (
'trace' => '
#0: Elementor\Core\Logger\Manager -> shutdown()
',
)]
PHP: 2023-01-20 11:40:32 [notice X 4][/web/wp/****/wp-content/plugins/elementor-pro/core/database/model-base.php::135] Return type of ElementorPro\Core\Database\Model_Base::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [array (
'trace' => '
#0: /web/wp/****/wp-content/plugins/elementor-pro/core/database/model-base.php(10): Elementor\Core\Logger\Manager -> rest_error_handler()
#1: /web/wp/****/wp-content/plugins/elementor-pro/plugin.php(154): class type include()array (
0 => '/web/wp/****/wp-content/plugins/elementor-pro/core/database/model-base.php',
)
#2: /web/wp/****/wp-content/plugins/elementor-pro/modules/notes/database/models/note.php(18): ElementorPro\Plugin -> autoload()
#3: /web/wp/****/wp-content/plugins/elementor-pro/plugin.php(154): class type include()array (
0 => '/web/wp/****/wp-content/plugins/elementor-pro/modules/notes/database/models/note.php',
)
#4: /web/wp/****/wp-content/plugins/elementor-pro/modules/notes/data/controller.php(243): ElementorPro\Plugin -> autoload()
',
)]

JS: showing 1 of 1JS: 2023-01-20 11:40:27 [error X 1][https://****/wp-content/plugins/elementor/assets/js/new-template.min.js?ver=3.10.1:2:2932] elementor_new_template_form_controls is not defined

== Elementor - Compatibility Tag ==

Elementor Pro: Compatible

== Elementor Pro - Compatibility Tag ==

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.