- ステータス
- 解決済み
- 報告対象
- Advanced Custom Fields Multilingual 1.10.4
- 解決されたバージョン
- 2.0.0
- 関連するプラグイン/テーマ
- Advanced Custom Fields (ACF)
- トピックタグ
- Compatibility
問題の概要
PHP 8.0を使用するサーバーでACFとWPMLを使用している場合、フィールドグループをオプションページに表示するように設定すると、以下のエラーが表示されます。
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
1つの有効な言語のみでWPMLをインストールすることは推奨されていませんのでご注意ください。
回避策
続行する前に、サイトの完全なバックアップを必ず取得してください。
- /wp-content/plugins/acfml/classes/strategy/repeater-shuffle/OptionsPage.phpファイルを編集します。
- 184行目に移動します。
- 次を:
return $this->element_translations[ $id ];
次のように置き換えます:
return $this->element_translations[ $id ] ?? [];