
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Yes - that would be fine. That will allow me to check with minimum installation.
Please send me duplicator copy of your site.
More info:
- https://toolset.com/faq/provide-supporters-copy-site/
I have set the next reply to private which means only you and I have access to it.
Hey Minesh. I will provide you the backup copy tomorrow.

Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
ok - fine.
I have set the next reply to private which means only you and I have access to it.
Minesh there are some issues while creating Duplicator backup, I do have a LocalWP full site backup. Will that work for you?
EDIT
This message was not showing as private, so I removed the file link.

Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I'm able to deploy the duplicator of the site on my local test server. I can see with the duplicator you shared it is using the Toolset Types plugin version 3.3.7.
The Types plugin version 3.3.7 is after new post relationship is implemented.
I would like to know that:
- Are you trying to update the Types plugin from 3.3.7 to 3.4.17 and you are facing the issues?
- What exact steps I should follow to see the issue?
- Do I require SQL file that holds the old post relationship (pre Types 3.0.x) ? If yes, where can I get that SQL file that holds old post relationship?
- Are you trying to update the Types plugin from 3.3.7 to 3.4.17 and you are facing the issues?
Yes exactly, once the plugin is updated and I run the Database migration suggested in plugin, I face the issues.
- What exact steps I should follow to see the issue?
Update the plugin
Migrate the database.
Search for an author name in site search, you will notice that search results do not contain posts of that author.
- Do I require SQL file that holds the old post relationship (pre Types 3.0.x) ? If yes, where can I get that SQL file that holds old post relationship?
Nope I don't think so, as the plugin version 3.3.7 is working fine for me, it's only after the update and migration the issue occurs.
Minesh any update about this?

Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
After debugging too much I found the cause of the issue.
The issue was from the custom code you added to your child theme's search.php file where you are trying to fetch the related child post IDs. You should always use the Toolset post relationship API to fetch the related posts using the specified functions.
In this case I've used the function toolset_get_related_posts():
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts
The custom code you added to your child theme's search.php file was here:
global $wpdb;
$author_posts = $wpdb->get_results(
$wpdb->prepare( "SELECT child_id FROM {$wpdb->prefix}toolset_associations WHERE parent_id=%d", $authorID )
);
$posts_in = array();
foreach( $author_posts as $ap ) {
$posts_in[] = intval( $ap->child_id );
}
- currently I've commented the above code with your theme's search.php file
I've replaced the above code with the following code with your search.php file available with your child theme:
=> themes/generatepress_child/search.php
$author_posts = toolset_get_related_posts(
$authorID, //Post to query by.
'article-authors', //Slug of the relationship to query by
'parent', //Name of the element role to query by.
999, //Maximum number of returned results
0, //Result offset
array( //Additional query arguments
),
'post_id', //Determines return type
'child', // which posts from the relationship should be returned
);
$posts_in = array();
foreach( $author_posts as $ap ) {
$posts_in[] = intval( $ap);
}
Now we can see the correct results:
=> hidden link
Can you please confirm it works as expected now.

Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Can you please confirm that the solution I shared above help you to resolve your issue.
Thank you Minesh, It seems that the issue is fixed. I am still testing the complete website for any remaining issues. Will update here in a day or two.

Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Glad to know that the solution I shared help you to resolve the issue. Yes, you can test it and feel free to mark this ticket resolved.