Skip Navigation

Resolved

Reported for: Advanced Custom Fields Multilingual 1.10.4

Resolved in: 2.0.0

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 ] ?? [];
    

2 Responses to “Advanced Custom Fields and PHP 8.0 - Offset warning and error on ACF options page when there is only one language”

  1. Hi,

    I bought WPML to translate my website. I am using the Wpresidence theme which is compatible.

    My problem is: I cannot translate the advanced search bar (I used the custom search fields). The main language is Spanish, when I change the language to English and translate it, when I go and check the Spanish website it changed to English too.

    I hope you can help me.

    I look forward to hearing from you.

    Kind regards,
    Arlette

    • Hello Arlette,
      I don’t think your issue is related to this errata. Could you please open a chat in our support forum so one of our specialists can assist you?
      Thank you for your help.
      Andrés