Skip to content Skip to sidebar

Resolved

Resolved in: Advanced Custom Fields Multilingual 2.2.2

Topic Tags: Compatibility

Overview of the issue

When using Advanced Custom Fields with WPML, you might experience a fatal error when opening an options page in a secondary language if the page contains a taxonomy field.

Fatal error: Uncaught Error: Maximum call stack size of 8339456 bytes reached. Infinite recursion? in .../plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Strings.php:78

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/plugins/acfml/classes/Options/EditorHooks.php file.
  • Look for line 103.
  • Replace:
    add_filter( 'acf/load_value', function( $value, $fieldPostId, $field ) use ( $postId ) {
            
  • With:
    add_filter( 'acf/load_value', \WPML\FP\Fns::withNamedLock( self::class, \WPML\FP\Fns::identity(), function( $value, $fieldPostId, $field ) use ( $postId ) {
            
  • Then, on line 134.
  • Replace:
    }, 10, 3 );
            
  • With:
    } ), 10, 3 );