I implemented your fix onto the live site and it worked great. But had 2 other issues come up.
1) Filter (Screenshot: Query FIlter):
I tried to implement the same search feature onto another view (Search Healthy Volunteers with RFG Locations ID: 18750) but it broke because I had a Query Filter applied to that view. How do i apply a filter to this view?
Here is the broken view. hidden link
2) Deleting entry in RFG (Screenshot: Delete RFG Data):
Another issue i had was that when I deleted a trial, the repeatable field group location did not delete. I found a way around it by deleting each RFG in the trial before deleting the trial. Is there another way to do this? I may have some trials with 150 RFG locations.
Here is the page with the deleted trials. hidden link
Hello. Thank you for contacting the Toolset support.
I see you have added the Query filter for the custom field "Healthy Volunteer" but please you need to understand that the field "Healthy Volunteer" is not the part of the repeating field group "List of Additional Locations" as the view is set to query the repeating field group "List of Additional Locations'. You can only add the filters for the fields of repeating field group "List of Additional Locations" as the view is set to query "List of Additional Locations".
I removed the Query filter for the field "Healthy Volunteer" and I can see the results now:
=> hidden link
We can move step by step, can you please confirm the above issue is resolved.
The issue when you delete the post, its associated repeating field group entries is not deleted is known to us and already reported in front of our Devs. It will be fixed in near future release but we do not have any ETA on it.
Maybe you should try to use the following workaround that may help you:
- Add the following code to "Custom Code" section of Toolset:
add_action( 'wp_trash_post', 'func_delete_child_related_posts', 10 );
function func_delete_child_related_posts( $post_id ) {
if ( get_post_type( $post_id ) == 'paid-clinical-trial' ){
// get child posts of this parent
$children = toolset_get_related_posts(
$post_id,
'additional-locations',
array(
'query_by_role' => 'parent',
'limit' => 999,
'return' => 'post_id',
'role_to_return' => 'child'
)
);
foreach ($children as $key => $child) {
wp_trash_post($child);
}
}
}