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

ปัญหาที่ทราบแล้วทั้งหมด →