WPML
状态
已解决
报告针对
WPML Multilingual CMS 4.6.2
相关插件/主题
The Events Calendar
主题标签
Compatibility

问题概述

如果您正在运行 PHP8+ 和 The Events Calendar,您会在已翻译的事件及其存档页面上看到致命错误:

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

临时解决方法

请在继续操作之前对您的站点进行完整备份


  1. 打开 …/wp-content/plugins/the-events-calendar/src/Tribe/Integrations/WPML/Views/V2/Filters.php 文件。

  2. 找到第 188 行。

  3. 将:
    $event->permalink = apply_filters( 'wpml_permalink', $event->permalink );

    替换为:
    // 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  );

所有已知问题 →