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

After update to wp 5.3 shortcodes shows wrong dates #9609

Closed Merlin1987 closed 4 years ago

Merlin1987 commented 4 years ago

Description

Hello,

i'm using Formidable Forms Plugin to create views from form entries and display them via shortcode in an elementor text element. After the update to WP 5.3 any date field shows a wrong date. For example in the database the value is 2020-10-16 (checked it in phpmyadmin) but in the frontend it shows 2020-10-15. At first i wouldn't think it's a problem of elementor but when i post the same shortcode in the normal Wordpress editor, it shows the correct date.

After i'm going back to wp 5.2.4 it worked fine again with all plugins updated and i found this in the changeling:

For Developers

Date/Time Component Fixes Developers can now work with dates and timezones in a more reliable way. Date and time functionality has received a number of new API functions for unified timezone retrieval and PHP interoperability, as well as many bug fixes.

Is Elementor doing anything with a date field before displaying it?

Steps to reproduce

Install WP 5.3, Latest Elementor and Formidable Plugin. Create form with date field, create form entry and display it via formidable views shortcode in an elementor text element.

Isolating the problem

Environment

System Info ``` == Server Environment == Operating System: Linux Software: Apache MySQL version: MariaDB Server v5.5.59-MariaDB-38.11 PHP Version: 7.2.20 PHP Max Input Vars: 5000 PHP Max Post Size: 51M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected == WordPress Environment == Version: 5.2.4 Site URL: https://strongdog.de Home URL: https://strongdog.de WP Multisite: No Max Upload Size: 50 MB Memory limit: 1024M Permalink Structure: /%year%/%monthnum%/%day%/%postname%/ Language: de-DE Timezone: Europe/Berlin Debug Mode: Inactive == Theme == Name: Elementor Hello Theme Version: 1.0 Author: Elementor Team Child Theme: No == User == Role: administrator WP Profile lang: de_DE User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15 == Active Plugins == Easy Smooth Scroll Links Version: 2.2 Author: WebFactory Ltd Ele Conditions Version: 1.0.5 Author: Liviu Duda Elementor Version: 2.7.5 Author: Elementor.com Elementor Pro Version: 2.7.3 Author: Elementor.com Email Log Version: 2.3.1 Author: Sudar Fix Image Rotation Version: 2.2.1 Author: Gagan Deep Singh Formidable API Version: 1.08 Author: Strategy11 Formidable Bootstrap Version: 1.02.02 Author: Strategy11 Formidable Export View to CSV Version: 1.0 Author: Strategy11 Formidable Form Action Automation Version: 2.03 Author: Strategy11 Formidable Forms Version: 4.03.04 Author: Strategy11 Formidable Forms Pro Version: 4.03.04 Author: Strategy11 Formidable Registration Version: 2.02.02 Author: Strategy11 Google Analytics Dashboard for WP (GADWP) Version: 5.3.9 Author: ExactMetrics Jetpack by WordPress.com Version: 7.9 Author: Automattic MailPoet 3 (New) Version: 3.39.2 Author: MailPoet MailPoet 3 Premium (New) Version: 3.0.73 Author: MailPoet Really Simple SSL Version: 3.2.6 Author: Rogier Lankhorst, Mark Wolters strongdog Version: 0.0.1 Author: Merlin Rose UpdraftPlus - Backup/Restore Version: 1.16.20 Author: UpdraftPlus.Com, DavidAnderson User Menus Version: 1.2.1 Author: Code Atlantic User Role Editor Version: 4.52.1 Author: Vladimir Garagulya Visibility Logic for Elementor Version: 1.0.4 Author: SeventhQueen WP Downgrade | Specific Core Version Version: 1.2.0 Author: Reisetiger Yoast SEO Version: 12.5 Author: Team Yoast == Log == JS: showing 5 of 5JS: 2019-08-20 18:03:08 [error X 1][https://strongdog.de/wp-content/plugins/elementor/assets/js/editor-modules.min.js?ver=2.6.8:2:38139] n.attributes[e.name].each is not a function. (In \'n.attributes[e.name].each(function(t){i.push(n.getStyleControls(e.fields,t.attributes))})\', \'n.attributes[e.name].each\' is undefined) JS: 2019-08-20 18:13:52 [error X 6][https://strongdog.de/wp-content/plugins/dynamic-visibility-for-elementor/assets/js/dce-editor-visibility.js?ver=3.0.1:87:27] Can\'t find variable: dce_enable_save_button JS: 2019-09-11 14:54:01 [error X 1][https://strongdog.de/wp-content/plugins/elementor/assets/js/frontend.min.js?ver=2.7.1:2:47496] undefined is not a function (near \'...n.background_slideshow_gallery.forEach...\') JS: 2019-10-21 17:22:58 [error X 1][https://strongdog.de/wp-content/plugins/elementor/assets/js/editor.min.js?ver=2.7.4:2:46149] undefined is not an object (evaluating \'this.ui.select.select2\') JS: 2019-10-24 12:00:15 [error X 1][https://strongdog.de/wp-content/plugins/elementor/assets/js/editor.min.js?ver=2.7.4:2:62480] undefined is not an object (evaluating \'this.ui.tools.hoverIntent\') Log: showing 20 of 382019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (10 of 1, 1000%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (11 of 1, 1100%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (12 of 1, 1200%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (13 of 1, 1300%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (14 of 1, 1400%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (15 of 1, 1500%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (16 of 1, 1600%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Start (17 of 1, 1700%) 2019-09-11 16:45:41 [info] Elementor/Upgrades - _v_2_7_0_rename_document_types_to_wp Finished 2019-09-11 16:45:41 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '2.6.8', 'to' => '2.7.1', )] 2019-09-16 19:06:03 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '2.7.1', 'to' => '2.7.2', )] 2019-09-25 14:33:00 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '2.7.2', 'to' => '2.7.3', )] 2019-09-25 14:33:00 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '2.6.5', 'to' => '2.7.0', )] 2019-10-01 15:38:54 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '2.7.0', 'to' => '2.7.1', )] 2019-10-08 20:38:40 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '2.7.3', 'to' => '2.7.4', )] 2019-10-08 20:38:40 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '2.7.1', 'to' => '2.7.2', )] 2019-10-08 20:38:41 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '2.7.3', 'to' => '2.7.4', )] 2019-10-08 20:38:41 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '2.7.1', 'to' => '2.7.2', )] 2019-10-29 07:56:32 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor', 'from' => '2.7.4', 'to' => '2.7.5', )] 2019-10-29 07:56:32 [info] Elementor data updater process has been completed. [array ( 'plugin' => 'Elementor Pro', 'from' => '2.7.2', 'to' => '2.7.3', )] == Elements Usage == footer button : 2 heading : 5 nav-menu : 3 social-icons : 1 text-editor : 3 theme-site-logo : 1 header template : 3 popup text-editor : 1 section button : 3 heading : 2 image : 7 nav-menu : 2 text-editor : 5 theme-site-logo : 2 single heading : 3 post-info : 1 post-navigation : 1 theme-post-content : 3 theme-post-title : 2 wp-post accordion : 2 button : 12 countdown : 6 google_maps : 1 heading : -76 icon-list : 7 image : 2 image-carousel : 4 posts : 1 spacer : 2 template : 20 text-editor : -39 toggle : -11 video : 6 wp-page button : -4 google_maps : 1 heading : -160 icon-list : -5 image : -15 template : 3 text-editor : -68 toggle : -10 video : 1 ```
Merlin1987 commented 4 years ago

I found this on Wordpress.org https://wordpress.org/support/topic/read-this-first-wordpress-5-3-master-list/

Dates or times being incorrect, permalinks being off by a day, other weirdness related to “time”

WordPress 5.3 received a significant upgrade to its date and time handling code. The previous code dated all the way back to over 10 years ago, when PHP 4 was still supported. This was a significant chunk of code scattered all through the core of WordPress, and it was very slow and a drag on performance.

With 5.3, most of this code has been updated or replaced with saner PHP 5.6 compatible code. A lot of the legacy has been removed. However, some plugins and themes may have relied on the side effects from how this code previously operated.

For this reason, some plugins or themes may be doing incorrect things. One such thing would be to call the date_default_timezone_set() function in PHP. WordPress works by setting the default timezone to UTC and then performing its own calculations to adjust times. Setting the default timezone incorrectly to anything else will result in these calculations being incorrect. WordPress will be overcompensating the timezone adjustments.

For backwards compatibility, it is crucial that plugins not change the default PHP timezone. The default timezone must be set to UTC at all times. Any problems you find with timezones or dates shifting is likely going to be a plugin or theme which is doing-it-wrong. This may not have mattered as much in previous versions of WordPress, but now that WordPress is using these newer functions more and less reliant on the old PHP 4 compatible code, then this is far more critical.

If you find a plugin or theme with a problem like this, please report it to their authors, or report it to the plugins team.

shilo-ey commented 4 years ago

Hi @Merlin1987

We tried to reproduce your issue. It does replicate, but when disabling Elementor completely it also shows the wrong value.

Try contacting Formidable forms plugin authors.

Thanks