Skip Navigation

[Resolved] “There was a problem creating the related content” problem in types beta

This thread is resolved. Here is a description of the problem and solution.

Problem: I am unable to create related content from the post editor screen in the new betas. I see an error in the logs: "WordPress database error Unknown column 'association.trid' in 'field list'".

Solution: This problem has been resolved in the latest beta plugins. Please update to receive the latest versions.

This support ticket is created 6 years, 10 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 8 replies, has 2 voices.

Last updated by Christian Cox 6 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#608243

Howdy,

After putting the project on hold for some time, I came back to working on my database site which will have information about series, characters, production companies etc.
Since it relies heavily on many-to-many relationships and wasn't in a working state where I left it, I figured I might as well try the new beta so that I'll be able to get used to the new post relationships under development.
However, it seems that something went wrong, as whenever I try to connect an existing post to another post (with an already established relationship between their post types) I get an error message saying "There was a problem creating the related content: Database error occurred when creating an association: Error when inserting a row in the associations table."

On a slightly unrelated note, it seems that the new relationship system doesn't support many to many to many post relationships. Previously I've been able to use a single post type as a child of three other custom post types and connect all of them, but now it seems that I can neither do this, nor can I include a 'post reference' as a field of an intermediary post to do the same thing.
An example for what I used this for in the past was to use the child cpt 'appearance' to link between characters, series they appear in and their voice actors in said series. A solution for that would also be highly appreciated.

Nevertheless I do like the simplicity of establishing and managing new relationships in the new system and looking forward to what's coming next 🙂

Thank you,
Amos

#608341

whenever I try to connect an existing post to another post (with an already established relationship between their post types) I get an error message saying "There was a problem creating the related content: Database error occurred when creating an association: Error when inserting a row in the associations table."
Okay thanks for the report. Can you turn on server-side logging to see if there are more details available about this failure? If you are not familiar with server logs, I can show you how to enable them temporarily. Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);

Then add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

Attempt to connect some related posts again. If any more detailed logs are generated, this will create an error_log.txt file in your site's root directory. Please send me its contents. Once that is done, you can revert the changes you made to wp-config.php.

On a slightly unrelated note, it seems that the new relationship system doesn't support many to many to many post relationships.
Only two post types can be included in any Relationship. What you are describing actually sounds like 3 one-to-many relationships, where all 3 post types are related to the same child post. This is still possible in the new M2M system, you must create a child post type with 3 different one-to-many relationships.

#608395

Hi Christian,

Thank you for the prompt reply.
You're definitely right about the post-to-post connectivity, guess I wasn't thinking straight..
As for the log, that's what it says:

[21-Jan-2018 21:57:15 UTC] WordPress database error Unknown column 'association.trid' in 'field list' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT association.trid AS trid, association.relationship_id AS relationship_id, association.id AS association_id, association.parent_id AS parent_id, association.child_id AS child_id, association.intermediary_id AS intermediary_id FROM zsli_toolset_associations AS association WHERE association.relationship_id = 29 AND parent_id = 29270 AND child_id = 31153 LIMIT 1 made by do_action('wp_ajax_types_related_content_action'), WP_Hook->do_action, WP_Hook->apply_filters, Toolset_Ajax->__call, Types_Ajax_Handler_Related_Content_Action->process_call, Types_Ajax_Handler_Related_Content_Action->insert_connect, Toolset_Relationship_Definition->create_association, Toolset_Relationship_Database_Operations::create_association, Toolset_Relationship_Driver->create_association, Toolset_Potential_Association_Query_Posts->check_single_element, Toolset_Potential_Association_Query_Posts->is_element_already_associated, Toolset_Association_Query->get_results, Toolset_Relationship_Query_Base->get_results

[21-Jan-2018 21:57:15 UTC] WordPress database error Unknown column 'trid' in 'field list' for query SELECT MAX(trid) FROM zsli_toolset_associations made by do_action('wp_ajax_types_related_content_action'), WP_Hook->do_action, WP_Hook->apply_filters, Toolset_Ajax->__call, Types_Ajax_Handler_Related_Content_Action->process_call, Types_Ajax_Handler_Related_Content_Action->insert_connect, Toolset_Relationship_Definition->create_association, Toolset_Relationship_Database_Operations::create_association, Toolset_Relationship_Driver->create_association, Toolset_Relationship_Driver->translate_and_insert, Toolset_Relationship_Database_Operations::get_next_trid

[21-Jan-2018 21:57:15 UTC] WordPress database error Unknown column 'trid' in 'field list' for query INSERT INTO `zsli_toolset_associations` (`relationship_id`, `parent_id`, `child_id`, `intermediary_id`, `trid`, `lang`, `translation_type`) VALUES ('29', 29270, 31153, 0, 1, '', 'none') made by do_action('wp_ajax_types_related_content_action'), WP_Hook->do_action, WP_Hook->apply_filters, Toolset_Ajax->__call, Types_Ajax_Handler_Related_Content_Action->process_call, Types_Ajax_Handler_Related_Content_Action->insert_connect, Toolset_Relationship_Definition->create_association, Toolset_Relationship_Database_Operations::create_association, Toolset_Relationship_Driver->create_association, Toolset_Relationship_Driver->translate_and_insert

Thanks again,
Amos

#608580

Okay thanks. Does this only happen with CPTs that were created before you installed the Betas? For example, if you create two new custom post types - "CPT 1" and "CPT 2" - and set up a many-to-many relationship between these new post types, are you able to connect any CPT 1 to any CPT 2?

#608606

Hi Christian,

Just tried this now, created 2 new CPTs and set a many to many relationship between them, same problem..

Amos

#608651

Okay thanks, I'm not sure what could be causing this issue so I would like to log in to your wp-admin area, create a clone of your site, install it locally and run some tests. If that is okay with you, please provide login credentials in the private reply fields here. I will install the Duplicator plugin to create the clone and get started.

#609421

Okay I've been able to run some tests on my clone of your site, and I can confirm the behavior you described. I'm not able to replicate this on a clean installation, so this seems to be an exception. I will escalate the issue to my 2nd tier support team for some additional investigation. Standby and I will update you shortly.

#609488

Okay I have some feedback. It appears that the missing table is related to WPML, so there is a conflict between WPML and Toolset beta plugins. I've escalated this issue to Toolset developers so it can be fixed in a future version. I'm not sure if that fix will be part of the next beta release, or if it will come in a subsequent beta, but I will keep you posted here. If any workaround is made available, I will share that as soon as I can.

#627375

Hi, just a quick update to let you know this issue has been resolved in the latest beta plugin updates. You can now find those beta plugins in your account downloads area here at https://toolset.com/account/downloads

Please update to the latest versions and let me know if the problem is unresolved. Thank you for your patience.