WPML

문제 개요

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

임시 해결 방법

이 문제는 Advanced Custom Fields Multilingual 2.1.0에서 해결되었습니다. 업데이트하면 사이트에서 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.

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

  • …/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 );
    	}

모든 알려진 문제

여전히 이 문제가 발생합니까?

업데이트해도 문제가 해결되지 않으면 지원 문의를 하세요. 함께 살펴보겠습니다.