WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.6.2
Related plugin/theme
The Events Calendar
Topic tags
Compatibility

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.


  1. Open the …/wp-content/plugins/the-events-calendar/src/Tribe/Integrations/WPML/Views/V2/Filters.php file.

  2. Look for line 188.

  3. 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  );

All known issues →