• Resolved Sefam

    (@sefam)


    I am currently using WPML to manage my translations, but I’ve noticed something fairly annoying with custom fields. Let’s say I have two languages and a custom text field called “meta-text”:

    English (The original language)
    French (The alternate language)

    I fill out my custom field in English, and then I publish a translation. Everything is dandy so far and works as it should; if “meta-text” isn’t filled in the translation, it takes the English value. The custom fields are also set to “Copy Once”.

    The issue comes in when I attempt to empty out fields. If I go to the French post, and empty out “meta-text”, and try to update the post, it will simply save the text from the English post in its stead. However, if I update the custom field by myself in the WP Custom Fields panel and make the field empty, and press the “update” button in that panel, it updates fine, but as soon as I update the post itself, I run into the same problem; it copies the English text over.

    However, if I try to change the field to anything that isn’t empty, it seems to work properly.

    This is somewhat an issue with repeatable groups as there’s no way to remove all the groups if the original language has groups itself.

    I’ve tried reaching out to WPML support, but all they’ve been doing so far is making me jump through hoops and try to sell me more plugins.

    Is this a WPML problem or a CMB2 problem? I have trouble imagining how it would be the latter as everything else seems to work fine.

    • This topic was modified 7 years ago by Sefam.
    • This topic was modified 7 years ago by Sefam.
    • This topic was modified 7 years ago by Sefam.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Suggestion: Put a html no-breaking space in it to simulate empty.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I feel like I’ve answered this same topic somewhere else, but can’t recall or locate where.

    This is an issue on WPML’s side since they’re the ones providing the functionality that isn’t playing so nicely, especially around what they’re copying/duplicating for their content. Chances are they’re trying to keep things in sync, and when the French version gets removed, it tries to do a fallback of some sort, thus it copies back in the English version.

    Thread Starter Sefam

    (@sefam)

    I figured that much. I was just incredibly annoyed at the time to get told to “just go get ACF”, when it seems like ACF has the same problem. I’ve had a followup with WPML and they haven’t been very helpful, instead providing me with some sort of hack when I provided them with basic code to fix some other issue stemming from some example custom field code I provided as they implied that the problem was CMB2’s fault, which it isn’t.

    And while dkurth’s idea might work on text fields, this is more of an issue with repeatables and file fields. That gets jarring with clients in cases where they want a repeatable in both languages.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I can definitely understand the frustrations all around. Wish I could be better help at the exact moment. That said, my apologies for the rather long delay in a response. I missed seeing it initially.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘CMB2 repopulating empty custom fields with WPML’ is closed to new replies.