Skip Navigation

[Resolved] WPML with post relationship in CRED FORMS

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#957255
Screenshot 2018-07-27 15.19.19.png
Screenshot 2018-07-27 15.19.02.png
Screenshot 2018-07-27 15.05.44.png
Screenshot 2018-07-27 15.05.37.png

I want to add new post as child post. Let's say we have highschool as parent and studycourses as children

We use WMPL to provide multilingual content

So, I have several issues:

Then I try to add child studycourse to highschool, I use cred form and use url param "hsid" as id of parent highschool in CRD form for new studycourse post.

As result I have several issues:
1. id of parenthighschool depends on language I use. So, for ru version ID=1, for de version ID=2, etc... So, I'm not sure how relationships tracks multilingual parent id. Probably I should forward some language independent post id for highschool to studycourse cred form?

2. second issue is after I saved my studycourse post. The issue is that I have ru language as default. But I add new studycourse in my de version. So, as result my new studycourse post in de language, but has no default language post. And there is no relationship with any parent post type, including highschool parent post, which was pointed in cred form. In the same time there is no option in admin dashboard to add parent manually.
So, probably it should be some way to add default language copy of post automatically with adding new sub-language version.
Or it should be some language settings, which could connect posts to parent not depend on default language version?

#957898

Well, I have to inform you that right now, Toolset Forms does not connect Parent Post when creating new Child Posts and WPML Core is used to translate the posts, Create Form unable to create new Post if WPML is active and O2M relationship is set

The issues require at least 2 languages, 2 CPT's (Custom Post Types), made translatable.
Those, if in a O2M (One To Many Relationship), will not connect the parent you choose in the form, if you create new child posts with Toolset Forms.
==> Disable WPML Core, issue dissolved.

So, pretty much, right now this does not work.

We ar working on the issues and resolving them and I can update you here in regard if you want once it's solved.

Related to your questions:
1. id of parenthighschool depends on language I use. So, for ru version ID=1, for de version ID=2, etc... So, I'm not sure how relationships tracks multilingual parent id. Probably I should forward some language independent post id for highschool to studycourse cred form?

Previously, in Types before 3.0 you had to set a hidden custom field value of the child post which saved the parent post ID.
That is not anymore like this.
We now have a new API and create database tables for the connections, so we can handle as well many to many relations.

There is however no API for the relationship forms yet that you can apply - there is only the Types API now:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
This can help you set a parent, but not in a Toolset Form with API code as those new forms do not respond to that API.

When you want to preset a parent in a Child Form, it depends what kind of relation ship this is, I'd need to know more details about it so I can tell how to populate (if possible) the form to automatically connect a given parent.
In theory, as it will not work, as above outlined, as long WPML is active.

To the second question, you need to always first connect the default language:
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-related-content/
In turn, you do not need to maintain connections between translations.

I hope the developers will have a solution for the issues as soon as possible so I can let you know here and you can proceed with the project.

#957962

Hi Beda,

Thanks for info.
Of course I can’t disable WPML core due to multilingual site structure.
Yes, please keep me posted about updates on your development to fix this issue.

#1087482

Our developers have let me know that this issue will be resolved in Forms 2.1. I will keep you posted here as I receive information about the next release schedule.

#1099566

Hi, please find Forms 2.1 avaialable for download or automatic update. This version of the plugin includes a permanent fix for this issue. Let me know if the problem is not fully resolved in Forms 2.1.

#1105676
Screenshot 2018-09-12 01.23.14.png

Hi Christian,

Thanks for update. It still doesn't work - I have the same issue in backend and in front end even worst - instead of available dropdown list of possible relationships, I just have them disabled and see label that there is no possible to connect posts in not default language.

#1106816

Okay may I have access to your wp-admin area? I would like to make a clone of your site so I can run some additional tests and get feedback from our developers. If that's okay with you, please provide login credentials in the private reply fields here.

#1109039

Thanks for update. It still doesn't work - I have the same issue in backend and in front end even worst - instead of available dropdown list of possible relationships, I just have them disabled and see label that there is no possible to connect posts in not default language.
This behavior is expected. When logged in as an administrator you will see the message that it is not possible to connect posts in non-default language. Non-administrator Users will not see this message. As Beda said:

To the second question, you need to always first connect the default language:
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-related-content/
In turn, you do not need to maintain connections between translations.

As the documentation says:

You cannot connect posts that do not have a default language version.

We have not changed that part of the process. You must still create the related content in the default language first, then you can translate that related post. Prior to this release, it was not even possible to connect posts in the default language when the post types were translatable, because there was a bug in the software. That bug has been resolved, but it doesn't allow you to create translated related content in the non-default language before the default language related content has been created. It only fixes the problem in the default language.

Please let me know if you have questions about this.

#1109443

Hi Christian,

Thanks for the explanation. I actually didn't have bug you described.
I have not a bug, but really simple sitiation, which, I beleive, have a lot of sites built on both your plugins.

Let's say:
- I have EN and DE versions of website
- primary language is EN
- I have some objects, like... let's say Topic and messages connected to topic. Or messages and other messages as reply to other messages. Simple user features.
- so, no I have a huge problem: if my user of German version added some Topic in German, the same user have and all other users have no possibility to add any messages (nor EN, nor DE) to Topic until somebody will translate it to primary language...

This looks really strange to me.
Could you explain how this simple situation could be solved for now?

From my point of view there is only solution like no use Relationship feature at all and connect Messages to Topics by post id field. But it is strange not to use one of the most powerful features of your plugin.

Another option is not using WPML for Message or Topic translations, but use repeating field or some special post type for translating Message and Topic fields. Which also strange due to a lot of useful features in WPML in general.

So, I will appreciate your advice about possibility to have not primary language content relationships by using your plugins functionality.

#1109692

Could you explain how this simple situation could be solved for now?
I wish I could offer a good solution, but I cannot. It is not possible to use Toolset's Post Relationships to connect secondary-language content that does not yet exist in the primary language:
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-related-content/
https://wpml.org/forums/topic/assign-translated-child-page-to-different-translated-parent-page/

I do not have a code snippet or suggestion that will solve this problem. The content must be created first in English before you can add related posts in German. Any workaround will require some manual intervention in wp-admin before the new German post is visible in the German site.

I understand this is a big problem for your site, and I encourage you to submit a feature request by creating a new ticket in the forum using the "Suggest an improvement" option. Describe the problem and our developers will evaluate your request. As more people request this feature, our developers will be more likely to include it in a future release.

#1109753

Christian,
thanks for your reply. I add suggestion for new functionality here: https://toolset.com/forums/topic/post-relationships-for-secondary-languages-only-post/
But I still really surprised that this absolutely natural feature for UGC multilingual website didn't included in core of your post-relationship.
As I wrote before, it is just more convinient stop using post relationships at all for this kind of website...

I also wondering what will happens if I will change primary language - it looks like my post relationships just will be destroyed absolutely 🙁

#1110681

But I still really surprised that this absolutely natural feature for UGC multilingual website didn't included in core of your post-relationship. As I wrote before, it is just more convinient stop using post relationships at all for this kind of website.
I understand what you're saying. I will bring this issue up for discussion in my team meeting tomorrow morning and try to get some additional information. I'll let you know what I find out.

I also wondering what will happens if I will change primary language - it looks like my post relationships just will be destroyed absolutely
We recommend you do not change the site's primary language after setting up post relationships. You're likely to experience unpredictable errors, because the system was not designed to support this type of major change.

#1110853

We recommend you do not change the site's primary language after setting up post relationships. You're likely to experience unpredictable errors, because the system was not designed to support this type of major change.

I see... but this way it is much more critical to have language unrelated relationships... I mean I could live with RU main language for interface... But I couldn't ask all users from EN or DE version to translate their content to RU for any kind of relationship between content types... 🙁

Anyway, I will waiting for any update about this issue...

#1111639

There is nothing new to report from my support team, unfortunately. At this time Toolset does not support the multilingual post relationship features you have described. The next step towards getting that functionality added to our software is to file a feature request, and you have done that. I can see that Nigel will be following up with our developers, so he may have more information to share in the feature request ticket. I suggest we close this ticket and use the feature request ticket to track progress of the suggested improvement.

#1117211

Hi Christian,
Yes, let's close this case and update the issue through new feature suggestion.