Skip Navigation

[Resolved] Error: Class 'Toolset_Relationship_Element_Type' not found

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Tagged: 

This topic contains 21 replies, has 3 voices.

Last updated by Waqar 4 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#1397749

SAME ISSUE ON LIVE SITE AND LOCALHOST, 2017 THEME AND ONLY TYPES & VIEWS ACTIVE.

I am trying to: Add a post relationship field.

Link to a page where the issue can be seen: http:hidden link

I expected to see: a new post relationship field

Instead, I got:
( ! ) Fatal error: Uncaught Error: Class 'Toolset_Relationship_Element_Type' not found in C:\wamp64\www\acs\wp-content\plugins\types\vendor\toolset\types\includes\classes\class.types.admin.edit.custom.fields.group.php on line 1681
( ! ) Error: Class 'Toolset_Relationship_Element_Type' not found in C:\wamp64\www\acs\wp-content\plugins\types\vendor\toolset\types\includes\classes\class.types.admin.edit.custom.fields.group.php on line 1681
Call Stack
# Time Memory Function Location
1 0.0008 473280 {main}( ) ...\admin.php:0
2 0.7918 70383288 do_action( ) ...\admin.php:232
3 0.7918 70383696 WP_Hook->do_action( ) ...\plugin.php:478
4 0.7918 70383728 WP_Hook->apply_filters( ) ...\class-wp-hook.php:312
5 0.7961 70666344 wpcf_admin_menu_edit_fields_hook( ) ...\class-wp-hook.php:288
6 0.8100 72223712 Types_Admin_Edit_Custom_Fields_Group->form( ) ...\admin.php:496
7 0.8100 72223712 Types_Admin_Edit_Custom_Fields_Group->save( ) ...\class.types.admin.edit.custom.fields.group.php:124
8 0.8713 74760792 Types_Admin_Edit_Custom_Fields_Group->save_group_fields( ) ...\class.types.admin.edit.custom.fields.group.php:1298
9 0.9128 76065792 Types_Admin_Edit_Custom_Fields_Group->save_post_reference_field( ) ...\class.types.admin.edit.custom.fields.group.php:1581

#1397789

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Thank you for getting in touch. Since this is on a local server, there isn't much debugging I can do.

I would suggest re-downloading the Types plugin and install it again to see if this helps.

If it doesn't work please let me know.

Thanks,
Shane

#1397839

Hi Shane, tried removing and re adding Types & Views, no change.
Issue is the same on the live site, used a local site so I could change themes and de activate all the other plugins.

On the live site the error is produced by this page:-
hidden link

And in the error file found within wp-admin we get this error:-

[02-Dec-2019 15:06:34 UTC] PHP Fatal error: Uncaught Error: Class 'Toolset_Relationship_Element_Type' not found in /home/admiralcareservi/public_html/wp-content/plugins/types/vendor/toolset/types/includes/classes/class.types.admin.edit.custom.fields.group.php:1681
Stack trace:
#0 /home/admiralcareservi/public_html/wp-content/plugins/types/vendor/toolset/types/includes/classes/class.types.admin.edit.custom.fields.group.php(1581): Types_Admin_Edit_Custom_Fields_Group->save_post_reference_field(Object(WP_Post), Array)
#1 /home/admiralcareservi/public_html/wp-content/plugins/types/vendor/toolset/types/includes/classes/class.types.admin.edit.custom.fields.group.php(1298): Types_Admin_Edit_Custom_Fields_Group->save_group_fields(176531)
#2 /home/admiralcareservi/public_html/wp-content/plugins/types/vendor/toolset/types/includes/classes/class.types.admin.edit.custom.fields.group.php(124): Types_Admin_Edit_Custom_Fields_Group->save()
#3 /home/admiralcareservi/public_html/wp-content/plugins/types/vendor/toolset/types/admin.php(496): Types_Admin_Edit_Custom_Field in /home/admiralcareservi/public_html/wp-content/plugins/types/vendor/toolset/types/includes/classes/class.types.admin.edit.custom.fields.group.php on line 1681

The post type I'm adding a reference too has 35+ fields, could this cause an issue? I've tried increasing memory and max vars in the PHP settings, but no joy

#1397913

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Would you mind allowing me to have admin access to the live site so that I can have a look to see what is happening here ?

The private fields have been enabled for your next response.

Thanks,
Shane

#1398075

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

I see you site is still using the old relationship method.

Could you run the migration here hidden link

Once you have done this please let me know if you're still experiencing the same issue.

Thanks,
Shane

#1398103

Thanks Shane, the relationships migration tool found the following backwards compatibility issues:-

Type Location Problematic code
Toolset Form #36893: "Add Care Plan" - line 41, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #40113: "Service User Qs" - line 62, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #42403: "Service User File note" - line 13, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #44726: "Test HR Note" - line 22, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #44880: "Send Note to SENIOR HR Team" - line 20, column 22 _wpcf_belongs_hr-record-basic_id' v
Toolset Form #44954: "Send Note to Care Team" - line 19, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #50806: "Upload HR Document" - line 21, column 22 _wpcf_belongs_hr-record-basic_id' c
Toolset Form #55187: "Spot Checks Form" - line 6, column 22 _wpcf_belongs_hr-record-basic_id' v
Toolset Form #55286: "Accident or Near Miss Form" - line 7, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #55286: "Accident or Near Miss Form" - line 11, column 22 _wpcf_belongs_hr-record-basic_id' v
Toolset Form #75187: "Upload Service User Document" - line 12, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #75213: "Send a Note to the HR Team" - line 16, column 22 _wpcf_belongs_hr-record-basic_id' v
Toolset Form #88760: "Add Check In" - line 7, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #89089: "Add Check Out" - line 7, column 22 _wpcf_belongs_service-user-basic-d_
Toolset Form #117441: "Add Daily Records to Service User" - line 15, column 23 _wpcf_belongs_service-user-basic-d_
Toolset Form #176196: "Supervision" - line 11, column 23 _wpcf_belongs_hr-record-basic_id' c

What do I need to do here?

Many thanks,
D

#1399197

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

These are because of the forms using the old relationship methods.

What you will perhaps need to do is to run the migration update and then re-create the forms or just re-add the relationship fields to the form.

The new relationship would look something like this on your form.

<div class="form-group">
		<label>Manufacturers Cars</label>
		[cred_field field='@manufacturer-car.parent' class='form-control' output='bootstrap' select_text='--- not set ---']
	</div>

Where "manufacturer" is the parent and "car" is the child. These are both the slugs of each individual CPT.

Please let me know if this helps.
Thanks,
Shane

#1402777

Here is an example from my install:-

field="_wpcf_belongs_service-user-basic-d_id"

This allows posts created by this form to select a parent. The parent slug is service-user-basic-d the child slug is add-care-plan.

So is the new syntax:
field='@service-user-basic-d-add-care-plan.parent'

Correct?

Thanks,

D

*** If you can enable private fields again I'll send direct links to the edit & view pages for these posts, their forms and views.

#1402931

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Yes that is correct.

You will need to update your forms relationship fields accordingly.

Thanks,
Shane

#1404103

I've updated all of the fields, now I am getting an SQL error.

> Post relationships migration started.
> Maintenance mode enabled.
> No tables had to be dropped.
> Unable to create table RQ7T2sewUU_toolset_associations due to a MySQL Error:
> Unable to create table RQ7T2sewUU_toolset_relationships due to a MySQL Error:
> Unable to create table RQ7T2sewUU_toolset_type_sets due to a MySQL Error:
> Maintenance mode disabled.
> Post relationships migration started.
> Maintenance mode enabled.
> No tables had to be dropped.
> Unable to create table RQ7T2sewUU_toolset_associations due to a MySQL Error:
> Unable to create table RQ7T2sewUU_toolset_relationships due to a MySQL Error:
> Unable to create table RQ7T2sewUU_toolset_type_sets due to a MySQL Error:
> Maintenance mode disabled.

Thats the log from the migration tool.
It shows 2 attempts. After the first attempt I went into the Database and dropped those 3 tables. After the second attempt I checked the database and they HAVE been created OK.

Here is the MYSQL Log
2019-06-13T15:19:49.450332Z 0 [Warning] InnoDB: Resizing redo log from 2*3072 to 2*16384 pages, LSN=2524994
2019-06-13T15:19:49.555201Z 0 [Warning] InnoDB: Starting to delete and rewrite log files.
100 200
100 200
2019-06-13T15:19:50.100683Z 0 [Warning] InnoDB: New log files created, LSN=2524994
InnoDB: Progress in percent: 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

& this is with only types and views running. 2017 theme.

(Have tried changing php versions from 7. 3 -> 7.2, no effect, no errors in PHP Log)

#1404867

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

If you could locate the php logs of your site.

Then there should be a better error logging on the issue there. It should tell us the exact statement that was ran as well as the error that was being returned.

Could you check for this and let me know.

Thanks,
Shane

#1404959

I cleared the log of historic stuff (a month ago, related to php version change) and reran the migration, there are no PHP errors, the log stays empty.
There is nothing in the browser console either

#1404961
migration error.JPG

Re ran it again to be sure, PHP log stays empty.

#1406107

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Would you mind if I took a copy of your site to test here locally?

This way I can investigate the issue further ?

Please let me know.
Thanks,
Shane

#1406555

Sure, what do you need from me?

Thanks,
D