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.58k stars 1.42k forks source link

CSS Styles for specific page copied between pages via Section Templates. #16374

Open AndrzejBaran opened 3 years ago

AndrzejBaran commented 3 years ago

Prerequisites

Description

When creating a template from exisiting section, CSS styles for current webpage are getting copied to template and to all other webpages where this template is used. There are no webpage CSS setting in template editor, so these setttings can't be removed.

Steps to reproduce

  1. Create a new Page (Page1), add a section with any content (example: header and text with Lorem ipsum)
  2. In Page CSS (Settings->Advanced->Custom CSS) add any style (example: body { background-color: black !important;})
  3. Create a template from created section (Right click on section -> Save as Template), give it any name.
  4. Publish page with any title.
  5. Create a new Page (Page2), add a section with Template Block, select Template created in step 3.
  6. Publish Page2.
  7. Page2 has now styles from Page1 added in step 2 that can't be edited in Page2 settings, changing them in Page1 settings don't change them and in Template editor there are no Custom CSS Settings.

Isolating the problem

Environment

System Info ``` == Server Environment == Operating System: Linux Software: nginx/1.10.3 MySQL version: mariadb.org binary distribution v10.3.29 PHP Version: 7.4.18 PHP Max Input Vars: 1000 PHP Max Post Size: 100M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected == WordPress Environment == Version: 5.8.1 Site URL: http://elementor.axonaris.work Home URL: http://elementor.axonaris.work WP Multisite: No Max Upload Size: 100 MB Memory limit: 512M Permalink Structure: /%postname%/ Language: en-US Timezone: Europe/Warsaw Debug Mode: Inactive == Theme == Name: Hello Elementor Version: 2.3.1 Author: Elementor 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/93.0.4577.82 Safari/537.36 == Active Plugins == Elementor Version: 3.4.4 Author: Elementor.com Elementor Pro Version: 3.2.1 Author: Elementor.com Head, Footer and Post Injections Version: 3.2.2 Author: Stefano Lissa Jetpack Version: 9.8.1 Author: Automattic Safe SVG Version: 1.9.9 Author: Daryll Doyle == Elementor - Compatibility Tag == Elementor Pro: Incompatible == Elementor Pro - Compatibility Tag == == Elements Usage == section : 2 heading : 1 search-form : 1 text-editor : 1 wp-page : 3 button : 3 divider : 8 eael-lightbox : 1 eael-post-carousel : 1 form : 1 gallery : 1 heading : 25 icon-box : 19 image : 12 image-box : 2 nav-menu : 1 posts : 3 search-form : 1 template : 1 testimonial-carousel : 1 text-editor : 3 == Log == PHP: showing 6 of 6PHP: 2021-03-26 15:44:17 [notice X 18][/home/axonaris/elementor/wp-content/plugins/elementor/includes/managers/image.php::86] Trying to access array offset on value of type bool [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2021-03-26 15:51:43 [error X 2][/home/axonaris/elementor/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php::281] Uncaught Error: Call to a member function update_meta() on null in /home/axonaris/elementor/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php:281 Stack trace: #0 /home/axonaris/elementor/wp-content/plugins/elementor-pro/modules/theme-builder/classes/conditions-manager.php(162): ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->save_conditions() #1 [internal function]: ElementorPro\Modules\ThemeBuilder\Classes\Conditions_Manager->ajax_save_theme_template_conditions() #2 /home/axonaris/elementor/wp-content/plugins/elementor/core/common/modules/ajax/module.php(171): call_user_func() #3 /home/axonaris/elementor/wp-includes/class-wp-hook.php(292): Elementor\Core\Common\Modules\Ajax\Module->handle_ajax_request() #4 /home/axonaris/elementor/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #5 /home/axonaris/elementor/wp-includes/plugin.php(484): WP_Hook->do_action() #6 /home/axonaris/elementor/wp-admin/admin-ajax.php(187): do_action() #7 {main} thrown [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2021-04-06 11:53:24 [notice X 13][/home/axonaris/elementor/wp-content/plugins/elementor-pro/license/updater.php::85] Undefined index: new_version [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2021-04-07 14:38:30 [notice X 11][/home/axonaris/elementor/wp-content/plugins/elementor/core/common/modules/ajax/module.php::171] Undefined index: data [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2021-04-11 00:00:29 [notice X 23][/home/axonaris/elementor/wp-content/plugins/elementor/includes/managers/image.php::80] Undefined offset: 2 [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] PHP: 2021-04-15 20:58:56 [warning X 1][/home/axonaris/elementor/wp-content/plugins/elementor-pro/modules/assets-manager/asset-types/icons/custom-icons.php::180] unlink(arrow-down.svg): No such file or directory [array ( 'trace' => ' #0: Elementor\Core\Logger\Manager -> shutdown() ', )] Log: showing 14 of 142021-04-29 16:52:08 [info] elementor::elementor_updater Started 2021-04-29 16:52:08 [info] Elementor/Upgrades - _v_3_2_0_migrate_breakpoints_to_new_system Start 2021-04-29 16:52:08 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.1.4', 'to' => '3.2.2', )] 2021-04-29 16:52:15 [info] Elementor/Upgrades - _v_3_2_0_migrate_breakpoints_to_new_system callback needs to run again 2021-04-29 16:52:15 [info] Elementor/Upgrades - _v_3_2_0_migrate_breakpoints_to_new_system Start (x2) 2021-04-29 16:52:16 [info] Elementor/Upgrades - _v_3_2_0_migrate_breakpoints_to_new_system Finished 2021-04-29 16:52:16 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.1.4', 'to' => '3.2.2', )] 2021-04-30 11:36:46 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '3.1.1', 'to' => '3.2.1', )] 2021-06-14 11:09:55 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.2.2', 'to' => '3.2.4', )] 2021-09-21 18:24:30 [info] elementor::elementor_updater Started 2021-09-21 18:24:30 [info] Elementor/Upgrades - _on_each_version Start 2021-09-21 18:24:31 [info] Elementor data updater process has been queued. [array ( 'plugin' => 'Elementor', 'from' => '3.2.4', 'to' => '3.4.4', )] 2021-09-21 18:24:31 [info] Elementor/Upgrades - _on_each_version Finished 2021-09-21 18:24:31 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '3.2.4', 'to' => '3.4.4', )] ```
immortaly007 commented 2 years ago

Similarly, but even worse: I used selector in the Custom CSS of a page (to just select the whole page), and then created a template from one of the elements/sections on the page. What happened was that the selector is applied to every sub-element of the created template.

For example, I had a page with a Custom CSS like:

selector::before {
    content: '' 
    /* And then it added some background elements to the page *?
}

In the created template from one of the sections on that page, those background elements would be added to EVERY sub element on the created template, meaning I would have countless background elements flying around the template.

FelloDuarte commented 2 years ago

Same here, created templates based on other templates and the css from the original keeps showing up on the new ones. I cleaned the css from the "child" templates via sftp but everytime I update any of them the "parent" template selectors are copied again. Thought it was a cache issue but no.

willdobson79 commented 2 years ago

I have discovered this just today too. I'm surprised it's still an issue... never noticed having this problem before strangely. It affects new section templates created from pages holding custom css (page settings - custom css). If I create a section from a page with custom css then this css is invisibly copied to the new section section template custom CSS - for which no css editor is available! and it is regenerated by Elementor if removed from css file. Need to somehow edit 'custom page CSS' for the section template to remove.

It would seem the only solution at present is to recreate the section template after having temporarily deleted the custom page CSS (and saved) on the page it's coming from before adding the CSS back in after.