WPML
Status
Resolved
Reported for
Advanced Custom Fields Multilingual 1.10.4
Resolved in
2.0.0
Related plugin/theme
Advanced Custom Fields (ACF)
Topic tags
Compatibility

Overview of the issue

When using ACF and WPML on a server using PHP 8.0, setting a field group to be displayed on the options page will show the following errors:

Warning: Trying to access array offset on value of type null in /wp-content/plugins/acfml/classes/strategy/repeater-shuffle/OptionsPage.php on line 184
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /wp-content/plugins/acfml/classes/strategy/repeater-shuffle/strategy.php on line 126

Please keep in mind that it is not recommended to install WPML with only one active language.

Workaround

Please be sure you have a full backup of your site before proceeding.


  1. Edit the file /wp-content/plugins/acfml/classes/strategy/repeater-shuffle/OptionsPage.php.

  2. Go to to line number 184.

  3. Replace:
    return $this->element_translations[ $id ];

    With:

    return $this->element_translations[ $id ] ?? [];

All known issues →