Skip Navigation

[Resolved] post relationships

This support ticket is created 4 years, 1 month 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 4 years ago.

Assisted by: Nigel.

Author
Posts
#1832169

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

Since Types 3.0 we introduce new relationship - you should check the following blog post:
=> https://toolset.com/2018/05/toolset-post-relationships-release/

We also offer new post-relationship API :
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
"

Is there a similar example that we can see?

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

#1832841

Nigel
Supporter

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

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

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).

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

I believe the Broadcast plugin developer is in direct contact with the Types developer here.

#1833795

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

#1835335

Nigel
Supporter

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

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

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.