Tell us what you are trying to do?
October 30, 2020 at 7:47 pm #1830085 REPLY
perryL
I have been trying to address with no luck so far.
For some reason, there are two toolset associations tables: wp_toolset_associations and wp_toolset_associations_old on my site hidden link
This is a dev site created just to address this issue.
For example, post 1896 (Tam webinar 22) hidden link has its associations stored in the _old table.
The 'Broadcast' plugin is using the _associations table to look up the relationships, but this table doesn't seem to be used by Types on my site.
I am able to do custom development to address but am trying to understand how Toolset has these organized.
Can you help me understand what's going on with the two associations tables ? and if they can be merged? (I didn't manage to find any tools / settings to merge the tables in the Toolset WP admin UI)Is there any documentation that you are following?
from previous reply: "Toolset Types plugin is using custom database tables to store the post type relationships, for example you can use some Mysql Tools(PHPmyadmin) to open your database, there are two tables for storing the post type relationships and associations:
- wp_toolset_associations
- wp_toolset_relationships
What is the link to your site?
transportationmanagement.net is a dev site just for fixing this issue. the broadcast plugin developer is also helping to address just looking for clearer understanding of how toolset has these tables organized
right now, can't broadcast post relationships or repeatable field groups
Types 3.4 updated the database structure for storing relationships.
If you have a table wp_toolset_associations_old that means that you have completed the migration to the new structure.
Relationship storage is now split across two tables, wp_toolset_associations and wp_toolset_connected_elements.
The ids of the posts involved in relationships are now stored in wp_toolset_connected_elements. The ids of the rows in wp_toolset_associations no longer refer directly to the ids of the posts, but instead to the ids of the rows in wp_toolset_connected_elements.
We discourage direct manipulation of the database tables, and instead encourage use of the APIs (which are unaffected by the change in table structures, this or any future ones).
Some questions on the suggestion to use the API:
It looks like it is incomplete for what we need to do - which is get and create relationships, get and create elements, get and create associations. And it appears it requires that you know which relationships are being used in the association before you can query the associations?
Is this correct?
The issue is that for this application there is no easy way of creating Toolset relationships - either using the API or manually
From the description of the things you want to do, it seems like the thing that's missing from the API is the ability to create relationships, you can certainly get relationships and get and create associations between posts using existing relationships, and can discover what relationships a post type is involved in etc.
Anyway, I checked with the Types developer and he confirmed he is still in direct communication with the Broadcast plugin developer about his requirements, so I'm not sure there is much for us to do here as they are best placed to identify what may be lacking and how to fill any gaps.