Support

Account

Home Forums Backend Issues (wp-admin) WPML options fields

Solved

WPML options fields

  • We’re having an issue with the options page when upgrading from ACF 5.2.2 to 5.2.3. We’re running latest WP and WPML. Previously it has worked fine, we don’t translate field groups with WPML, but could have different content on options pages in different languages.

    When upgrading to 5.2.3, all of a sudden the options page content in the secondary language, has the same data as the primary language. If we downgrade to 5.2.2 again, we don’t have this issue.

    I read the “Core: Fixed WPML bug where field group translation information is lost” comment for 5.2.3 version, I presume this is related.

  • I had the same problem. When I downgrade to 5.2.2 it works good

  • Yes, same problem here this morning.

    This was a very usefull features to setup 1 fields definitions and have the possibility to register multiple value of all fields in differents languages.

    If you trace the MySQL Queries, we can see that all the values are stories in wp_options table with a prefix for every tuple “option”/”language”. For instance the field “option_fb” is saved this way:

    – options_de_option_fb > Dutch version
    – options_it_option_fb > italian version
    – and so on…

    when you ask the option_fb field from your theme, ACF is smart enought to get the good translation

    so, if this options could be rolled back, that would be a very good idea !

  • Hi guys

    Thanks for them bug report.
    It seems I’ve accidentally prevented ACF from altering the $post_id when WPML is active, but when the field group is not translatable.

    Can you please edit eh core/wpml.php file and change the __construct to:

    
    function __construct() {
    		
    		// global
    		global $sitepress;
    		
    		
    		// vars
    		$this->lang = ICL_LANGUAGE_CODE;
    		
    		
    		// update settings
    		acf_update_setting('default_language', $sitepress->get_default_language());
    		acf_update_setting('current_language', $this->lang);
    		
    		
    		// actions
    		add_action('acf/field_group/admin_head',		array($this, 'admin_head'));
    		add_action('acf/input/admin_head',				array($this, 'admin_head'));
    		
    		
    		// bail early if not transaltable
    		if( !$this->is_translatable() ) {
    			
    			return;
    			
    		}
    		
    		
    		// actions
    		add_action('acf/upgrade_start/5.0.0',			array($this, 'upgrade_start_5'));
    		add_action('acf/upgrade_finish/5.0.0',			array($this, 'upgrade_finish_5'));
    		add_action('acf/update_field_group',			array($this, 'update_field_group'), 2, 1);
    		add_action('icl_make_duplicate',				array($this, 'icl_make_duplicate'), 10, 4);
    		
    		
    		// filters
    		add_filter('acf/settings/save_json',			array($this, 'settings_save_json'));
    		add_filter('acf/settings/load_json',			array($this, 'settings_load_json'));
    		
    	}
    

    This should fix the issue.

    Please let me know.

    Thanks
    E

  • It’s working for me!!!

    Thanks.

  • Works for me too !

    Thank you Elliot, does this patch will be available in the next release ?

  • Hi guys

    Yes, this will be included in the next version, and I have also repackaged the current version with the fix.

    Thanks again for helping out with this one

    Cheers
    E

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘WPML options fields’ is closed to new replies.