Skip Navigation

[Resolved] When saving or adding Custom Field Groups, the error is thrown: Fatal error: Uncaught InvalidArgumentException in …/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php on line 28

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

Problem:
When saving or adding Fields to Custom Field Groups, the process fails in a:

Fatal error: Uncaught InvalidArgumentException in .../types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php on line 28

Solution:
Update Toolset to the latest releases.

0% of people find this useful.

This support ticket is created 5 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 8 replies, has 5 voices.

Last updated by Beda 5 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#1121733

We have upgraded to the latest version of types and it is no longer possible to add new fields to any post fields group. Upon attempting to add a new field, we get the error below. We use the relationship field in one of our post types, but this was never problem, until latest versions of Types. Now suddenly, we can't add any new fields any post fields group.

Fatal error: Uncaught exception 'InvalidArgumentException' in /nas/content/staging/osseonews/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php:28 Stack trace: #0 /nas/content/staging/osseonews/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition_factory.php(90): Toolset_Relationship_Query_Condition_Type->__construct('', Object(Toolset_Relationship_Role_Parent)) #1 /nas/content/staging/osseonews/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/relationship_query_v2.php(355): Toolset_Relationship_Query_Condition_Factory->has_type('', Object(Toolset_Relationship_Role_Parent)) #2 /nas/content/staging/osseonews/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/relationship_query_v2.php(350): Toolset_Relationship_Query_V2->has_type('', Object(Toolset_Relationship_Role_Parent)) #3 /nas/content/staging/osseonews/wp-content/plugins/types/application/models/post_type/relationship in /nas/content/staging/osseonews/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php on line 28

#1121945

OK, this is summing up.
I just replied to a similar one here:
https://toolset.com/forums/topic/unexpected-error-in-error-logs/

As that user points out, The problem started a couple of weeks ago.
I found, it seems to be not on all groups, and only where conditions are set on what Post Types to display.
I had removed those, re-saved the group and re-added the conditions (see the linked thread) which solved the issue.
Can you try if this helps?

I will now create a ticket for our 2nd Tier to look into this, however, it might be that a bug of past versions made the groups corrupted, and you would have to re-save those.

#1121947

I forgot to ask, from what Types version did you update from?

#1122275

I tried the solution you proposed on the other ticket and it didn't work. We removed all conditions of "Settings for the fields group > Appears on" and then re-save the Field Group. We still couldn't add any fields. Same exact error. Also, I would mention that the error does seem to only an be an issue with one particular field group. In theory, we could just create new groups and ignore this issue, but it could cause errors down the road and it would help to figure out what the error is. There is some bug here, if others are reporting the same issue. I believe the bug started when we upgraded to the verion of Types that updated how you deal with relationships. But, I don't recall.

We are using the latest version of Types, Version 3.1.1.

#1122971

Hi,

I'm posting here to notify you that we will launch a hotfix release that fixes this issue ASAP.

Please keep watching the ticket and we will notify you once we launch this release.

Thanks.

#1124532

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

We released Types 3.1.2 yesterday and it includes a fix which I think addresses your issue: https://toolset.com/download/toolset-types/#changelog

Could you please update and re-test?

#1125132

This is now solved as my colleagues mentioned.

Thank you for reporting the issue and your patience.

#1198559
Edit_Post_Type_‹_Unsynd_—_WordPress.png

** EDIT - This is a SiteGround Accelerator plugin caching issue **

FYI 3.2.4 still an issue when a custom field group has been deleted but was previously referenced in a post.

You can see the issue here:

./types/vendor/toolset/types/embedded/includes/fields-post.php:156

$groups = wpcf_admin_post_get_post_groups_fields( $post );

In my WP install, this contains a group that has been sent to Trash.

#1199813

I see you made an edit to your last reply, but this seems not related to the issue.
Please report this on a new ticket.

I have updated this ticket with the resolution to the bug reported.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.