Support

Account

Home Forums General Issues ACFML Illegal string offset: wpml_cf_preferences Reply To: ACFML Illegal string offset: wpml_cf_preferences

  • I’m getting an error in the user_set_sync_preferences function in acfml/classes/class-wpml-acf-field-settings.php. The error occurs on this line:

    
    $field_post_content['wpml_cf_preferences'] = $field_preferences;
    

    When I added some debug logging, I noticed that the $field_post_content is an empty array because $field_post->post_content is blank. When I log $field_post, it shows the page post itself, not the custom field post.

    Any tips on how to get this fixed?

    I have the wpml_cf_preferences field set in all of my fields (i.e., I can see the field set in my acf-json files). Since I’m entering the $field_object['wpml_cf_preferences'] != $field_preferences conditional, my wpml_cf_preferences field from the acf-json file must not be matching the $field_preferences variable, but where is this $field_preferences variable set? Is this caused by differences in the acf-json file and the database? I don’t see this issue in my local instance, but when I deploy to my staging environment (with the acf-json files in my git repo), I notice the issue.

    ACF PRO version: 5.7.10
    ACFML version: 1.1
    WPML Multilingual CMS version: 4.2.4.1