WPML
상태
해결됨
보고된 제품
Advanced Custom Fields Multilingual 2.0.5
해결된 버전
Advanced Custom Fields Multilingual 2.1.0
관련 플러그인/테마
Advanced Custom Fields (ACF)
주제 태그
Compatibility

문제 개요

Advanced Custom Fields 플러그인을 사용할 때 다음 치명적인 오류가 발생할 수 있습니다. 이 오류는 특히 PHP 8 이상에서 발생합니다:


Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in .../wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:259

임시 해결 방법

진행하기 전에 사이트를 전체 백업했는지 확인하세요.


  • …/wp-content/plugins/acfml/classes/class-wpml-acf-attachments.php 파일을 여세요.

  • 28번째 줄을 찾으세요.

  • 다음 부분을:
    			foreach ( $attachments as $key => $attachment_id ) {
    					$translated_attachments[ $key ] = apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );

  • 다음과 같이 바꾸세요:
    			foreach ( $attachments as $key => $attachment_id ) {
    				if (is_int($attachment_id)) {
    					$translated_attachments[ $key ] = apply_filters( 'wpml_object_id', $attachment_id, 'attachment', true );
    				}

알려진 모든 문제 →