Home › Toolset Professional Support › [Resolved] I can't create post relationships.
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.
Tagged: Types plugin
This topic contains 4 replies, has 2 voices.
Last updated by alisonC 3 years, 7 months ago.
I can't create post relationships of any sort, with or without intermediary post types. I've disabled all plugins, tried the default theme, etc. The symptoms are like this post: https://toolset.com/forums/topic/an-error-when-creating-a-relationship/
But -- I have confirmed that I have a table called [dbprefix]_toolset_relationships in my database. I've attached an image of the table structure in case that helps.
I have the following database errors when I load up the Post Relationships page:
WordPress database error: [Unknown column 'relationships.autodelete_intermediary' in 'field list'] SELECT relationships.id AS id, relationships.slug AS slug, relationships.display_name_plural AS display_name_plural, relationships.display_name_singular AS display_name_singular, relationships.driver AS driver, relationships.parent_domain AS parent_domain, relationships.child_domain AS child_domain, relationships.intermediary_type AS intermediary_type, relationships.ownership AS ownership, relationships.cardinality_parent_max AS cardinality_parent_max, relationships.cardinality_parent_min AS cardinality_parent_min, relationships.cardinality_child_max AS cardinality_child_max, relationships.cardinality_child_min AS cardinality_child_min, relationships.is_distinct AS is_distinct, relationships.scope AS scope, relationships.origin AS origin, relationships.role_name_parent AS role_name_parent, relationships.role_name_child AS role_name_child, relationships.role_name_intermediary AS role_name_intermediary, relationships.role_label_parent_singular AS role_label_parent_singular, relationships.role_label_child_singular AS role_label_child_singular, relationships.role_label_parent_plural AS role_label_parent_plural, relationships.role_label_child_plural AS role_label_child_plural, relationships.needs_legacy_support AS needs_legacy_support, relationships.is_active AS is_active, relationships.autodelete_intermediary AS autodelete_intermediary, relationships.parent_types AS parent_types_set_id, relationships.child_types AS child_types_set_id, GROUP_CONCAT(DISTINCT parent_types_table.type) AS parent_types, GROUP_CONCAT(DISTINCT child_types_table.type) AS child_types FROM wp_2d8262595e_toolset_relationships AS relationships JOIN wp_2d8262595e_toolset_type_sets AS parent_types_table ON (relationships.parent_types = parent_types_table.set_id ) JOIN wp_2d8262595e_toolset_type_sets AS child_types_table ON (relationships.child_types = child_types_table.set_id ) GROUP BY relationships.id WordPress database error: [Unknown column 'relationships.autodelete_intermediary' in 'field list'] SELECT relationships.id AS id, relationships.slug AS slug, relationships.display_name_plural AS display_name_plural, relationships.display_name_singular AS display_name_singular, relationships.driver AS driver, relationships.parent_domain AS parent_domain, relationships.child_domain AS child_domain, relationships.intermediary_type AS intermediary_type, relationships.ownership AS ownership, relationships.cardinality_parent_max AS cardinality_parent_max, relationships.cardinality_parent_min AS cardinality_parent_min, relationships.cardinality_child_max AS cardinality_child_max, relationships.cardinality_child_min AS cardinality_child_min, relationships.is_distinct AS is_distinct, relationships.scope AS scope, relationships.origin AS origin, relationships.role_name_parent AS role_name_parent, relationships.role_name_child AS role_name_child, relationships.role_name_intermediary AS role_name_intermediary, relationships.role_label_parent_singular AS role_label_parent_singular, relationships.role_label_child_singular AS role_label_child_singular, relationships.role_label_parent_plural AS role_label_parent_plural, relationships.role_label_child_plural AS role_label_child_plural, relationships.needs_legacy_support AS needs_legacy_support, relationships.is_active AS is_active, relationships.autodelete_intermediary AS autodelete_intermediary, relationships.parent_types AS parent_types_set_id, relationships.child_types AS child_types_set_id, GROUP_CONCAT(DISTINCT parent_types_table.type) AS parent_types, GROUP_CONCAT(DISTINCT child_types_table.type) AS child_types FROM wp_2d8262595e_toolset_relationships AS relationships JOIN wp_2d8262595e_toolset_type_sets AS parent_types_table ON (relationships.parent_types = parent_types_table.set_id ) JOIN wp_2d8262595e_toolset_type_sets AS child_types_table ON (relationships.child_types = child_types_table.set_id ) WHERE ( ( ( relationships.parent_domain = 'posts' ) AND ( parent_types_table.type = 'rep-item' ) ) OR ( ( relationships.child_domain = 'posts' ) AND ( child_types_table.type = 'rep-item' ) ) ) AND ( relationships.is_active = 1 ) AND ( ( ( relationships.parent_domain != 'posts' OR parent_types_table.type IN ( 'post', 'page', 'attachment', 'oembed_cache', 'user_request', 'rep-item', 'event-rep-item' ) ) ) AND ( ( relationships.child_domain != 'posts' OR child_types_table.type IN ( 'post', 'page', 'attachment', 'oembed_cache', 'user_request', 'rep-item', 'event-rep-item' ) ) ) ) AND ( relationships.origin = 'wizard' ) GROUP BY relationships.id
I've provided access to the admin, and am leaving debugging turned on. I'm actively working on the site, so I've turned plugins and themes that I need back on. Please let me know if you need anything else. Thanks in advance for your assistance on this!
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Alison
When I check the relationships table for a local test site I have an additional column autodelete_intermediary which your table appears to be missing (that's what the error describes).
I'm not sure how that would have happened, but assuming you don't having any existing relationships (you can't make any) you can try the following:
- using phpMyAdmin DROP the tables wp_toolset_associations, wp_toolset_relationships, and wp_toolset_type_sets
- in the wp_options table delete the row with the option name = toolset_relationship_db_layer
- deactivate then reactivate Types
That will recreate the missing tables. Check if wp_toolset_relationships now contains the missing column.
If not, let us know and we'll look into it further.
Worked perfectly. Thank you so much!
Quick (hopefully!) follow-up -- I see a table called _toolset_associations_old. This leads me to believe that you've changed the way this works since we originally installed Toolset on the starter WordPress install we often clone from when starting new sites.
Is that correct? If so, can I drop that table, assuming I don't have any old post relationships?
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
A new database schema was introduced in Types 3.3 (updating that introduced in 3.0), and that table is a backup of the old association records in case something failed during the migration.
If everything appears to work correctly (posts are connected to the expected other posts) then it would be redundant, you could delete it, yes.
Thank you!