Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 3.6.2

Resolved in: WPML 3.6.3

Overview of the issue

Currently, there appears to be some issues with parent-child relationships between custom post types in the plugin Types, when WPML is used.

Saving a post that has such a relationship may lead to loss of data.

We are currently working on resolving this issue.

Workaround

As a very crude workaround that will prevent the loss of data in old posts you can edit the relationship.php file found in the ../wp-content/plugins/types/library/toolset/types/embedded/classes/ folder.

Comment out the row 305:

$updated_id = wp_update_post( $post_data );

Please note that this is only to prevent loss of data in already existing posts. This will not have an effect on new posts that you create. It is recommended to wait for the official fix.

10 Responses to “WPML issues with custom post type relationships in Types”

    • Hi Davide,

      Yes: we will release the fix in the upcoming 3.6.3 version of WPML.

      We will also release a beta with that fix very soon.

      • Can we receive the fix today?
        Or, maybe, at least, is it possible to go back to the previous version of the plugin without any bad impact on the system?
        Can you explain us how to reinstall the previous version of the plugin without losing data?
        Thanks!!

      • I really want to be sure you realized the problem I found out.
        Here’s how to replicate it:
        1) install wordpress
        2) install TYPES
        3) install WPML + string translation + translation management
        4) set Italian as DEFAULT language and English as another language
        5) create a many to many relationships following exactly this exmaple: https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
        6) create some Bands and their english translation
        7) create some Events and their english translation
        8) open an Event (in DEFAULT language!) and relate some bands (create Appearances) to this event
        9) click Update and…BOOM!!! Magically all Appearances “disappears”
        10) have a look at the same Event in English (secondary language) and you can see all the appearances have not really disappeares, they magically moved to English!!!!
        THIS IS THE BUG as I explained you in my first post here and again hundred times.

        Am I clear enough? Can you understand me?
        Can you see the problem?
        Can you see that the new development version you sent me is still not solving the problem?

        PLEASE LET ME KNOW ASAP!
        THANKS

        • Hello,
          Please let me try to explain.
          You have a custom post type that was not set as translatable and not translated – ‘Appearances’
          In Types – you can have currently only one child or parent of the same custom post type in the relationship – so the problem that you were experiencing was because you duplicate, and the values for the relationship was overwritten with the latest value (the new duplicate post) – and they went assigned to the duplicated post.
          In order for this to work correctly – you need to have all custom post types translated, and after you create the parent “Appearance” – you need to translate to the other languages first, and then translate the child posts from Bands or Events.

          I hope that you understand me.

  1. WP 4.7.1
    Enfold 3.8.4

    Hallo,
    nach Installation von WPML ist die gesamte WordPress Oberfläche in English. Sprache lässt sich unter WordPress-Einstellungen nicht mehr umstellen. Default-Sprache in WPML Einstellungen ist Deutsch.

    Bitte um Hilfe.

  2. What is going on with this, is it fixed? I am having some strange occurances using toolset, wpml and genesis integrations.

    • Hello, the issue mentioned in this ticket should be fixed since WPML 3.6.3
      If you have some issues related to the same or other similar problem, then please open a new ticket in our support forum so that our specialists could investigate them.