Resolved
Reported for: WPML Multilingual CMS 4.6.2
Overview of the issue
If you are running PHP8+ and The Events Calendar, you will see a fatal error on the translated events and their archive page:
PHP Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in …/wp-content/plugins/sitepress-multilingual-cms/classes/url-handling/converter/class-wpml-url-cached-converter.php:46
Workaround
Please, make a full backup of your site before proceeding.
- Open the …/wp-content/plugins/the-events-calendar/src/Tribe/Integrations/WPML/Views/V2/Filters.php file.
- Look for line 188.
- Replace:
$event->permalink = apply_filters( 'wpml_permalink', $event->permalink );
With:
// WPML Workaround for compsupp-6706 $event_permalink = $event->permalink; if ( is_object($event_permalink) ) { $event_permalink = (string)$event_permalink; } $event->permalink = apply_filters( 'wpml_permalink', $event_permalink );
Thank you this helped me a lot, hope this will be fixed soon
I’m glad to know it helped! Thank you for your feedback.
We will keep this link updated once we have news.
Thanks. Works too for me.
I’m glad to know it worked for you!
Today’s (11th April 2023) update of The-Events-Calendar unfortunately broke it again. The workaround has to be done again.
I’m sorry to hear that. This fix needs to be implemented from The Events Calendar side.
We strongly recommend you to contact them.
👍