Skip Navigation

[Resuelto] Where save the Relationship of toolset on ddbb to break it? part2

This support ticket is created hace 2 años, 5 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Waqar hace 2 años, 5 meses.

Asistido por: Waqar.

Autor
Mensajes
#2380343

Updating relationship with wpimport i get more troubles with imposible relation that mix.
Where toolset save on ddbb the relations to check that happen?

#2381075

Hi,

Thank you for contacting us and I'd be happy to assist.

The Toolset's relationship setup consists of these 3 custom tables in the database:

{table_prefix}_toolset_relationships: This table stores the information about the defined post-relationships.

{table_prefix}_toolset_connected_elements: Whenever a post/page is connected in a relationship for the first time, it is assigned a unique element ID, which is stored in this table.

{table_prefix}_toolset_associations: Based on the element ID, this table stores the information about each relationship connection.

Due to the complex nature of this architecture, it is not recommended to make direct changes to these tables, for the relationship connection management.

Toolset offers a number of hooks/filters and also a bulk import feature for relationships, through the custom fields, as explained in these guides:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
https://toolset.com/course-lesson/import-posts-from-csv-with-relationships-using-wp-all-import/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2381137
Linker error.png

Yes, I know that it is dangerous to touch things at the DB level, but I have some cases that when they are linked, those posts are linked to things that they should not

For example I have a type called mutation which relationship table is
samples-mutation
and upn-mutation
in the image the mutation with ID 587026 should be linked to sample id 511799 which is your sample but that sample is linked to sample 511799 but it has also been linked to a PRCD type with id 511804, (and there is no relationship , between mutation and PRCD, if there is mutation shows, and PRCD and shows, but they are not from the same tree) And even if I delete the link and relink them using the toolset interface it relinks the 2 samples, and I need to see internal level if the sample has been corrupted or what happens

#2381293

Mut 587026 group 86724
Muestra 511799 group 85612
prc? 511804 group 85612
muestra2? 122878 group 12979

Correct link 587026 > 511799
Correct link 122878 > 511804
Cant exist 587026 > 85612 (no had none relationship bethewn them)

SELECT * FROM `rr1_toolset_associations` WHERE `parent_id` in (86724,85612,12979) or `child_id` in (86724,85612,12979)

id relationship_id parent_id child_id intermediary_id
10048 1 6715 12979 0
10261 2 12979 13214 0
146740 1 85611 85612 0
146750 8 12979 85612 0
146751 10 6715 85612 0
148841 2 85612 86719 0
148842 4 85612 86720 0
148843 4 85612 86721 0
148844 4 85612 86722 0
148845 4 85612 86723 0
152070 4 85612 86724 0

If I understood the explanation,
shouldn't 2 posts have the same group id?

#2382111

Thank you for sharing these details.

Recently, we've identified and fixed an issue where the id/group_id of two different posts in the '{table_prefix}_toolset_connected_elements' table could overlap or duplicate, in very specific high volume cases. A fix for this issue was covered in the Types 3.4.15 release.

For the already affected posts, you can follow these steps:

1. Create a full backup of the website.

2. Note down the post IDs of the posts involved in the incorrect relationship connections (both parent and child).

3. Find and delete all the records from the '{table_prefix}_toolset_connected_elements' table where the 'element_id' is one of the IDs noted in step 2.

4. After this change, when those posts will be connected in relationship connection again, a new record for them will be created in the '{table_prefix}_toolset_connected_elements' table and the incorrect connections will be fixed.

I hope this helps and let me know how it goes.