garak734
Forum Replies Created
-
Hi,
Thanks for the update.However, it appears there is another instance of _register_controls() in /yith-woocommerce-ajax-navigation/plugin-fw/includes/builders/elementor/class-yith-elementor-widget.php [Line 102]
I think this also needs changing to register_controls().
Thanks
See updated note to more recent ticket “Wrong date of acceptance of Privacy Policy by customers”
The error is caused if I edit an existing order in the backend of WooCommerce which has the date accepted already stored in postmeta with the meta_key = ‘_wpgdprc’ and a date in the past, this date is not shown – instead the current date is always displayed.
This is also the case when listing orders in WooCommerce – the original accepted date is ignored and the current date is displayed against all of the orders.
To fix it, edit /plugins/wp-gdpr-compliance/Integrations/Plugins/WooCommerce.php and:
Replace line [224]:
$value = $this->getAcceptedDate( ! empty( $date ) );
with:
if($date=='') { $value = ''; } else { $value = Time::localDateFormat( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $date ); }
Replace line [206]:
$value = $this->getAcceptedDate( ! empty( $date ) );
with:
if($date=='') { $value = ''; } else { $value = Time::localDateFormat( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $date ); }
Add after line [7]:
use WPGDPRC\Utils\Time;
This also fixes the issue of any records that were in the database before the plugin was added, in which case there is no record in postmeta and so no date to check.
Hi,
Thanks for the prompt response, I have tried the replacement function but the issue has not been fixed.
The function _register_controls() is still present in the code and is still being identified as deprecated.
If lines [86 – 88] are removed, the message no longer appears and elementor processes the register_controls() function without any problems:// protected function _register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
// $this->register_controls();
// }Hope that helps.
Hi,
Thanks for the prompt response, I have tried the replacement function but the issue has not been fixed.
The function _content_template() is still present in the code and is still being identified as deprecated.
If lines [145 – 147] are removed, the message no longer appears and elementor processes the content_template() function without any problems:// protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
// $this->content_template();
// }Hope that helps.
Hi,
Now running WordPress 5.9, Elementor 3.3.5 and Elementor Pro 3.6.1 with the Free version of YITH WooCommerce Ajax Product Filter 4.7.0Still getting entry in debug.log when I use Elementor to edit anything:
[17-Feb-2022 12:17:57 UTC] PHP Deprecated: _content_template is <strong>deprecated</strong> since version 2.9.0! Use Elementor\Controls_Stack::content_template() instead. in \wordpress\wp-includes\functions.php on line 5211 [17-Feb-2022 12:17:57 UTC] PHP Stack trace: [17-Feb-2022 12:17:57 UTC] PHP 1. {main}() \wordpress\wp-admin\post.php:0 [17-Feb-2022 12:17:57 UTC] PHP 2. require_once() \wordpress\wp-admin\post.php:12 [17-Feb-2022 12:17:57 UTC] PHP 3. do_action($hook_name = 'admin_action_elementor') \wordpress\wp-admin\admin.php:408 [17-Feb-2022 12:17:57 UTC] PHP 4. WP_Hook->do_action($args = [0 => '']) \wordpress\wp-includes\plugin.php:470 [17-Feb-2022 12:17:57 UTC] PHP 5. WP_Hook->apply_filters($value = '', $args = [0 => '']) \wordpress\wp-includes\class-wp-hook.php:327 [17-Feb-2022 12:17:57 UTC] PHP 6. Elementor\Core\Editor\Editor->init($die = '') \wordpress\wp-includes\class-wp-hook.php:303 [17-Feb-2022 12:17:57 UTC] PHP 7. Elementor\Core\Editor\Editor->print_editor_template() \wordpress\wp-content\plugins\elementor\core\editor\editor.php:158 [17-Feb-2022 12:17:57 UTC] PHP 8. include() \wordpress\wp-content\plugins\elementor\core\editor\editor.php:317 [17-Feb-2022 12:17:57 UTC] PHP 9. wp_footer() \wordpress\wp-content\plugins\elementor\includes\editor-templates\editor-wrapper.php:71 [17-Feb-2022 12:17:57 UTC] PHP 10. do_action($hook_name = 'wp_footer') \wordpress\wp-includes\general-template.php:3031 [17-Feb-2022 12:17:57 UTC] PHP 11. WP_Hook->do_action($args = [0 => '']) \wordpress\wp-includes\plugin.php:470 [17-Feb-2022 12:17:57 UTC] PHP 12. WP_Hook->apply_filters($value = '', $args = [0 => '']) \wordpress\wp-includes\class-wp-hook.php:327 [17-Feb-2022 12:17:57 UTC] PHP 13. Elementor\Core\Editor\Editor->wp_footer('') \wordpress\wp-includes\class-wp-hook.php:303 [17-Feb-2022 12:17:57 UTC] PHP 14. Elementor\Widgets_Manager->render_widgets_content() \wordpress\wp-content\plugins\elementor\core\editor\editor.php:824 [17-Feb-2022 12:17:57 UTC] PHP 15. Elementor\Controls_Stack->print_template() \wordpress\wp-content\plugins\elementor\includes\managers\widgets.php:452 [17-Feb-2022 12:17:57 UTC] PHP 16. Elementor\Modules\DevTools\Deprecation->deprecated_function($function = '_content_template', $version = '2.9.0', $replacement = 'Elementor\\Controls_Stack::content_template()', $base_version = *uninitialized*) \wordpress\wp-content\plugins\elementor\includes\base\controls-stack.php:1929 [17-Feb-2022 12:17:57 UTC] PHP 17. _deprecated_function($function = '_content_template', $version = '2.9.0', $replacement = 'Elementor\\Controls_Stack::content_template()') \wordpress\wp-content\plugins\elementor\modules\dev-tools\deprecation.php:239 [17-Feb-2022 12:17:57 UTC] PHP 18. trigger_error($message = '_content_template is <strong>deprecated</strong> since version 2.9.0! Use Elementor\\Controls_Stack::content_template() instead.', $error_type = 16384) \wordpress\wp-includes\functions.php:5211
I have edited /yith-woocommerce-ajax-navigation/includes/elementor/class-yith-wcan-elementor-reset-button.php and changed line [134] to protected function content_template() and this works.
Just change _content_template() to content_template() – without the leading ‘_’ underscore.
Hi Iván,
This is what is showing in the WordPress debug.log:[08-Nov-2021 14:18:09 UTC] PHP Deprecated: _content_template is <strong>deprecated</strong> since version 2.9.0! Use Elementor\Controls_Stack::content_template() instead. in C:\wamp64\www\porto-demo.local\wordpress\wp-includes\functions.php on line 5211 [08-Nov-2021 14:18:09 UTC] PHP Stack trace: [08-Nov-2021 14:18:09 UTC] PHP 1. {main}() C:\wamp64\www\porto-demo.local\wordpress\wp-admin\post.php:0 [08-Nov-2021 14:18:09 UTC] PHP 2. require_once() C:\wamp64\www\porto-demo.local\wordpress\wp-admin\post.php:12 [08-Nov-2021 14:18:09 UTC] PHP 3. do_action($hook_name = 'admin_action_elementor') C:\wamp64\www\porto-demo.local\wordpress\wp-admin\admin.php:408 [08-Nov-2021 14:18:09 UTC] PHP 4. WP_Hook->do_action($args = [0 => '']) C:\wamp64\www\porto-demo.local\wordpress\wp-includes\plugin.php:470 [08-Nov-2021 14:18:09 UTC] PHP 5. WP_Hook->apply_filters($value = '', $args = [0 => '']) C:\wamp64\www\porto-demo.local\wordpress\wp-includes\class-wp-hook.php:327 [08-Nov-2021 14:18:09 UTC] PHP 6. Elementor\Core\Editor\Editor->init($die = '') C:\wamp64\www\porto-demo.local\wordpress\wp-includes\class-wp-hook.php:303 [08-Nov-2021 14:18:09 UTC] PHP 7. Elementor\Core\Editor\Editor->print_editor_template() C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\core\editor\editor.php:164 [08-Nov-2021 14:18:09 UTC] PHP 8. include() C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\core\editor\editor.php:323 [08-Nov-2021 14:18:09 UTC] PHP 9. wp_footer() C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\includes\editor-templates\editor-wrapper.php:71 [08-Nov-2021 14:18:09 UTC] PHP 10. do_action($hook_name = 'wp_footer') C:\wamp64\www\porto-demo.local\wordpress\wp-includes\general-template.php:3031 [08-Nov-2021 14:18:09 UTC] PHP 11. WP_Hook->do_action($args = [0 => '']) C:\wamp64\www\porto-demo.local\wordpress\wp-includes\plugin.php:470 [08-Nov-2021 14:18:09 UTC] PHP 12. WP_Hook->apply_filters($value = '', $args = [0 => '']) C:\wamp64\www\porto-demo.local\wordpress\wp-includes\class-wp-hook.php:327 [08-Nov-2021 14:18:09 UTC] PHP 13. Elementor\Core\Editor\Editor->wp_footer('') C:\wamp64\www\porto-demo.local\wordpress\wp-includes\class-wp-hook.php:303 [08-Nov-2021 14:18:09 UTC] PHP 14. Elementor\Widgets_Manager->render_widgets_content() C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\core\editor\editor.php:830 [08-Nov-2021 14:18:09 UTC] PHP 15. Elementor\Controls_Stack->print_template() C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\includes\managers\widgets.php:385 [08-Nov-2021 14:18:09 UTC] PHP 16. Elementor\Modules\DevTools\Deprecation->deprecated_function($function = '_content_template', $version = '2.9.0', $replacement = 'Elementor\\Controls_Stack::content_template()', $base_version = *uninitialized*) C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\includes\base\controls-stack.php:1891 [08-Nov-2021 14:18:09 UTC] PHP 17. _deprecated_function($function = '_content_template', $version = '2.9.0', $replacement = 'Elementor\\Controls_Stack::content_template()') C:\wamp64\www\porto-demo.local\wordpress\wp-content\plugins\elementor\modules\dev-tools\deprecation.php:239 [08-Nov-2021 14:18:09 UTC] PHP 18. trigger_error($message = '_content_template is <strong>deprecated</strong> since version 2.9.0! Use Elementor\\Controls_Stack::content_template() instead.', $error_type = 16384) C:\wamp64\www\porto-demo.local\wordpress\wp-includes\functions.php:5211
I am running WordPress 5.8.1, Elementor 3.4.7 and YITH WooCommerce Ajax Product Filter 4.3.0
The function is in in yith-woocommerce-ajax-navigation/includes/elementor/class-yith-wcan-elementor-reset-button.php :
protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore $frontend = new YITH_WCAN_Frontend(); $_GET['min_price'] = 10; $_GET['max_price'] = 100; $_GET['onsale_filter'] = 1; $_REQUEST[ YITH_WCAN_Query()->get_query_param() ] = 1; $frontend->reset_button(); }
If I rename or comment out the whole function, the Deprecated message is not reported.
I do not have any other plugins/PHP code with ‘_content_template’ in the code.
Hope that helps track down the issue.
Thanks
Alan