Overview of the Issue
You may experience a fatal error after updating the Advanced Custom Fields Multilingual plugin to version 2.1.4.1 when also using the Advanced Custom Fields: Extended and Advanced Custom Fields Pro plugins:
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
Workaround
This issue is fixed in Advanced Custom Fields Multilingual 2.1.4.2. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Please, make sure of having a full site backup of your site before proceeding.
- Open …/wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php file.
- Look for line 280.
- Replace:
private static function isValidOptionPagePostId( $postId ) { return function_exists( 'acf_get_options_pages' ) && wpml_collect( acf_get_options_pages() )->first( Relation::propEq( 'post_id', $postId ) ); } - With:
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; }
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question