Hi Menno,
Thank you for waiting, while I performed some testing and research.
I can confirm that this is a known limitation, that to join two posts in a relationship, the primary language versions need to exist between them.
( this also applies to posts in post reference fields, since they also rely on post-relationship )
From your comments on the other tickets, I understand that your users will be creating posts in their own languages, which won't always be the same as the primary language.
To overcome this limitation, there are a few workarounds that you can use:
1. You can make sure that when a new post is created using a Toolset Form, a duplicate entry for it is also programmatically created, in the primary language. Toolset Forms API offers "cred_submit_complete" hook, which can be used to attach a custom function to a form submission:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete
You can also consult, WPML plugin's official support on how a translated/duplicated post in a different language can be created.
OR
2. Instead of using post-relationships or post reference field to connect two posts, you can use a regular "select" type custom field, that shows a list of available posts and then stores the ID of the selected post's ID in the custom field.
The "wpt_field_options" filter can be used to dynamically insert the options in a select type field:
Example:
add_filter( 'wpt_field_options', 'func_to_dynamically_populate_select_options', 10, 3);
function func_to_dynamically_populate_select_options( $options, $title, $type ){
switch( $title ){
case 'Field Title':
$options = array();
// add or generate the array of your desired option titles and values
$options[] = array('#value' => '', '#title' => '---',);
break;
}
return $options;
}
I hope this helps and please let me know if you need any further assistance around any of these workarounds.
regards,
Waqar