Home›Toolset Professional Support›[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
[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 6 years, 1 month 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.
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
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.
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.