The Events Calendar conflict Polylang PRO
-
Hi, while moving the calendar to another client page, I noticed that there is an error in connection with the Polylang PRO plugin.
It throws these errors (debu.log):[23-Aug-2023 17:39:50 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_month() on null in wp-content/plugins/the-events-calendar/common/src/Tribe/Date_Utils.php:863
Stack trace:
#0 /wp-content/plugins/the-events-calendar/common/src/Tribe/Date_Utils.php(745): Tribe__Date_Utils::build_localized_months()
#1 /wp-content/plugins/the-events-calendar/src/Tribe/Main.php(2419): Tribe__Date_Utils::get_localized_months_full()
#2 /plugins/polylang-pro/integrations/events-calendar/tec.php(245): Tribe__Events__Main->setup_l10n_strings()
#3 /wp-includes/class-wp-hook.php(312): PLL_TEC->fix_date_translations()
#4 /wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#5 /wp-content/plugins/the-events-calendar/common/src/Tribe/Date_Utils.php on line 863
The site catches a fatal error. Is there any workaround to this problem, for example by changing the code or forcing functions.php to change?
The problem only occurs when the PRO version is turned on, when turned off everything returns to normal.
public function fix_date_translations() { $properties = array( 'localized_months_full', 'localized_months_short', 'localized_weekdays', 'localized_months', ); foreach ( $properties as $property ) { $property = new ReflectionProperty( Tribe__Date_Utils::class, $property ); $property->setAccessible( true ); $property->setValue( array() ); } TEC::instance()->setup_l10n_strings(); }
Code snippet from 231 to 245 in polylang-pro/integrations/events-calendar tec.php
- The topic ‘The Events Calendar conflict Polylang PRO’ is closed to new replies.