- 상태
- 해결됨
- 보고된 제품
- Advanced Custom Fields Multilingual 2.1.4.1
- 해결된 버전
- Advanced Custom Fields Multilingual 2.1.4.2
- 관련 플러그인/테마
- Advanced Custom Fields: Extended
- 주제 태그
- Compatibility
문제 개요
Advanced Custom Fields: Extended 및 Advanced Custom Fields Pro 플러그인을 함께 사용하는 경우, Advanced Custom Fields Multilingual 플러그인을 버전 2.1.4.1로 업데이트한 후 치명적인 오류가 발생할 수 있습니다:
Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:112
임시 해결 방법
진행하기 전에 전체 사이트 백업을 완료했는지 확인하세요.
- …/wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php 파일을 여세요.
- 280번째 줄을 찾으세요.
- 다음 코드를:
private static function isValidOptionPagePostId( $postId ) { return function_exists( 'acf_get_options_pages' ) && wpml_collect( acf_get_options_pages() )->first( Relation::propEq( 'post_id', $postId ) ); } - 다음과 같이 교체하세요:
private static function isValidOptionPagePostId( $postId ) { if ( function_exists( 'acf_get_options_pages' ) ) { $optionPages = acf_get_options_pages(); if ( $optionPages ) { return wpml_collect( acf_get_options_pages() )->first( Relation::propEq( 'post_id', $postId ) ); } } return false; }