Resolved
Reported for: Advanced Custom Fields Multilingual 2.0.5
Resolved in: Advanced Custom Fields Multilingual 2.1.0
Overview of the issue
The following fatal error may occur when using Advanced Custom Fields plugin. The error is specifically observed with PHP 8 or higher:
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
Workaround
Please, make sure of having a full backup of your site before proceeding.
- Open …/wp-content/plugins/acfml/classes/class-wpml-acf-attachments.php file.
- Look for line 28.
- Replace:
12
foreach
(
$attachments
as
$key
=>
$attachment_id
) {
$translated_attachments
[
$key
] = apply_filters(
'wpml_object_id'
,
$attachment_id
,
'attachment'
, true );
- With:
1234
foreach
(
$attachments
as
$key
=>
$attachment_id
) {
if
(
is_int
(
$attachment_id
)) {
$translated_attachments
[
$key
] = apply_filters(
'wpml_object_id'
,
$attachment_id
,
'attachment'
, true );
}
Runs Perfect! Thank you so much!
You are welcome! Thanks for the feedback 🙂
Hello,
Just to let you know that this issue should have been solved with Advanced Custom Fields Multilingual 2.1.0.