WPML
Status
Resolved
Reported for
Advanced Custom Fields Multilingual 2.1.4
Resolved in
Advanced Custom Fields Multilingual 2.1.4.1
Related plugin/theme
Advanced Custom Fields (ACF)
Topic tags
Bug

Overview of the issue

If you have updated to Advanced Custom Fields Multilingual version 2.1.4 while using Advanced Custom Fields free version, you may encounter a fatal error due to an undefined function acf_get_options_pages():

PHP Fatal error:  Uncaught SymfonyComponentDebugExceptionFatalThrowableError: Call to undefined function acf_get_options_pages() in .../wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php:281

Workaround

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 (bool) wpml_collect( acf_get_options_pages() )
    			->first( Relation::propEq( 'post_id', $postId ) );
    	}


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

All known issues →