WPML
Trạng thái
Đã giải quyết
Được báo cáo cho
Advanced Custom Fields Multilingual 2.1.4.1
Đã giải quyết trong
Advanced Custom Fields Multilingual 2.1.4.2
Plugin/giao diện liên quan
Advanced Custom Fields: Extended
Thẻ chủ đề
Compatibility

Tổng quan về lỗi

Bạn có thể gặp phải lỗi nghiêm trọng sau khi cập nhật plugin Advanced Custom Fields Multilingual lên phiên bản 2.1.4.1 khi đồng thời sử dụng các plugin Advanced Custom Fields: ExtendedAdvanced Custom Fields Pro:

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

Giải pháp tạm thời

Vui lòng đảm bảo bạn đã tạo bản sao lưu toàn bộ trang web trước khi tiếp tục.


  • Mở tệp …/wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php.

  • Tìm dòng 280.

  • Thay thế:
    	private static function isValidOptionPagePostId( $postId ) {
    		return function_exists( 'acf_get_options_pages' )
    		       && wpml_collect( acf_get_options_pages() )->first( Relation::propEq( 'post_id', $postId ) );
    	}


  • Bằng:
    	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;
    	}

Tất cả các lỗi đã ghi nhận →