Skip Navigation

[Closed] After update, issue with the new wp_toolset_associations table

This support ticket is created 4 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.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 4 years, 3 months ago.

Author
Posts
#1816441

Before updating Toolset, we could find relationships between related posts from wp_toolset_associations table using parent_id and child_id columns.
Parent_id used to have postID of the parent CPT and child_id of the related post.
This allowed us to write a custom search script that could search in parent and related tables.
In our case we have publishers and authors CPT and both are related using a toolset relationship manager.

Now after we updated the toolset plugin, our custom query is no longer working. We looked into the database and found wp_toolset_associations has been renamed to wp_toolset_associations_old
and the new wp_toolset_associations table doesn't seem to hold the same relationship data like before.
Lets say one of our publisher post id is 4429 and Author post id is 528. Previously we could find the information in a single row of wp_toolset_associations in parent_id and child_id columns
But this is no longer the case.
Could you please explain how is the parent and child relationship maintained in the new toolset database?

#1817121

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The relationship data are now split across 2 tables.

You will notice there is a new table wp_toolset_connected_elements. That table stores the IDs of the posts (without specifying the relationships they belong to or their role in the relationship).

The updated wp_toolset_associations table still records the connections between posts, but now references the posts indirectly via the wp_toolset_connected_elements table, rather than directly in wp_posts.

I'd recommend rather than directly querying the database tables you try to work with the API functions such as toolset_get_related_posts, which haven't changed with the update.

See: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

The topic ‘[Closed] After update, issue with the new wp_toolset_associations table’ is closed to new replies.