- الحالة
- محلولة
- أُبلغ عنها لـ
- 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 ); }