Skip Navigation

[Resolved] 'toolset_relationships' doesn't exist

This support ticket is created 4 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by svenA-3 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1656827

I am trying to:
Save a custom form, after which a hooked script performs several tasks. Ran well until I attempted to create a post and have the logged in user become author of the post. On using wp_insert_post for this purpose, my hosting provider's protocol shows the error mentioned above. Redundantly tested, coincidence with attempt to send the form confirmed.

Link to a page where the issue can be seen: hidden link (form restricted to specific user role)

I expected to see: form sent and become empty (set to stay on form page, no redirection)

Instead, I got: form remains filled out, no data sent. none of the script's actions performed, error message in protocol file

#1656851

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share details - are you using Toolset post form? If yes:
- what hook you are using and what error you see? If you can share more details and what you have exactly where and what is your goal that information will help me to guide you in the right direction.

#1656857

Hi Minesh,

thanks for the swift response here. The error message is quoted in the headline of my request. The form is a toolset user form; the post command is part of the hooked script that is fired upon sending the form at the following hooks:

add_action('user_register','addetermin',10,1);
add_action('profile_update','addetermin',10,1);

The table is actually missing from the database as the protocol noted.

Maybe the issue vanishes on table creation, thus an SQL command to create an empty relationships table the proper way would be my first approach. Can you provide it (I have no idea what that table looks like).

#1656909

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is really strange and I wonder why you use those hooks as Toolset Form's offers the hook cred_save_data or cred_submit_complete that should be triggered after you submit the form.

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

Can you please share access details so I can verify few things.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1656985

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I checked and there is no wp_toolset_relationships table available with your database.

You can create a new table using the following Create Table script. Please make sure to attach correct database prefix.

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

 DROP TABLE IF EXISTS `wp_toolset_relationships`;
CREATE TABLE IF NOT EXISTS `wp_toolset_relationships` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `slug` varchar(190) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `display_name_plural` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `display_name_singular` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `driver` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `parent_domain` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `parent_types` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `child_domain` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `child_types` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `intermediary_type` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `ownership` varchar(8) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'none',
  `cardinality_parent_max` int(10) NOT NULL DEFAULT '-1',
  `cardinality_parent_min` int(10) NOT NULL DEFAULT '0',
  `cardinality_child_max` int(10) NOT NULL DEFAULT '-1',
  `cardinality_child_min` int(10) NOT NULL DEFAULT '0',
  `is_distinct` tinyint(1) NOT NULL DEFAULT '0',
  `scope` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL,
  `origin` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_name_parent` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_name_child` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_name_intermediary` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_label_parent_singular` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_label_child_singular` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_label_parent_plural` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `role_label_child_plural` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  `needs_legacy_support` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  `autodelete_intermediary` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `slug` (`slug`),
  KEY `is_active` (`is_active`),
  KEY `needs_legacy_support` (`needs_legacy_support`),
  KEY `parent_type` (`parent_domain`,`parent_types`),
  KEY `child_type` (`child_domain`,`child_types`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

Also, please note that the code you are using is custom code, however you should consider the Toolset From's hook I shared with my previous rerply.
More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_submit_complete

#1656987

OK, this improved the situation as the form works again. In the protocol now two more tables are announced missing:

toolset_type_sets
toolset_associations

Will they be created on first relationship entry in the new table I've set up with your SQL statement or will I have to create them manually too? In the latter case, I'd need the fitting SQL commands same as before.

#1657017

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I am not sure why those tables are not created.

Here is SQL script for table: wp_toolset_type_sets


SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Table structure for table `wp_toolset_type_sets`
--

DROP TABLE IF EXISTS `wp_toolset_type_sets`;
CREATE TABLE IF NOT EXISTS `wp_toolset_type_sets` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `set_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `type` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `set_id` (`set_id`),
  KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

And here is the SQL script for table: wp_toolset_associations

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
 --
-- Table structure for table `wp_toolset_associations`
--

DROP TABLE IF EXISTS `wp_toolset_associations`;
CREATE TABLE IF NOT EXISTS `wp_toolset_associations` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `relationship_id` bigint(20) UNSIGNED NOT NULL,
  `parent_id` bigint(20) UNSIGNED NOT NULL,
  `child_id` bigint(20) UNSIGNED NOT NULL,
  `intermediary_id` bigint(20) UNSIGNED NOT NULL,
  PRIMARY KEY (`id`),
  KEY `relationship_id` (`relationship_id`),
  KEY `parent_id` (`parent_id`,`relationship_id`),
  KEY `child_id` (`child_id`,`relationship_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
#1657075

Same Day assistance and solution delivered within the hour. My issue is resolved now. Thank you!