Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 4.6.2

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

7 Responses to “The Events Calendar - Fatal error on translated events and archive when using PHP 8+”

  1. 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.