Skip Navigation

[Resolved] Fatal error: Uncaught InvalidArgumentException when saving new custom field

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

Problem:
Fatal error: Uncaught InvalidArgumentException when saving new custom field

Solution:
With Types new version 3.1.2 this issue is resolved.

Relevant Documentation:

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.

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 6 replies, has 3 voices.

Last updated by LCR 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1120103

LCR

I am trying to:
Update a custom field group with a new custom field and it causes a Fatal Error. I can create new custom field groups and create custom fields but I'm unable to add a new field after the initial save.

Link to a page where the issue can be seen:
This is on a development server and isn't publicly available.

I expected to see:
I expect the custom field group to save and accept my new field update.

Instead, I got:
This page isn't working

This is what I got via WordPress debug:
Fatal error: Uncaught InvalidArgumentException in /var/www/html/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php:28 Stack trace: #0 /var/www/html/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 /var/www/html/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 /var/www/html/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 /var/www/html/wp-content/plugins/types/application/models/post_type/relationships_settings/relationship_settings.php(240): Toolset_Relationship_Query_V2->has_type('') #4 /var/ww in /var/www/html/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php on line 28

#1120450

It seems you have an RFG on those Custom Fields Groups, is this possible?
I tried several scenarios but could not replicate such an error.
I have however similar (and also not replicable yet) errors here:
https://toolset.com/forums/topic/fatal-error-uncaught-invalidargumentexception-first-argument-is-not-a-post/
https://toolset.com/forums/topic/php-fatal-error-uncaught-invalidargumentexception-on-custom-field-saving/

They may be related.

Can you maybe send me the exported Types and Fields from Toolset > Import/Export or a full copy of the site?
https://toolset.com/faq/provide-supporters-copy-site/

Also, it can help to test if without any other Plugin and a native theme this persists

#1121567

Minesh
Supporter

Languages: English (English )

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

Well - could you please tell me with custom field group you are having issue with?

#1121613

LCR

Do your tests using 'Metadata for Search Engines' custom field group as it's the one that gives me the issue every time, but I have been able to recreate the issue with all field groups.

#1122674

Minesh
Supporter

Languages: English (English )

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

Well - we have a couple of more users reporting the same issue. I've passed your duplicator to our next level support for further debugging.

Please hold on for further updates, I'll get in touch with you as soon as I know more.

#1124333

Minesh
Supporter

Languages: English (English )

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

We just published Types new version 3.1.2.
=> https://toolset.com/download/toolset-types/#changelog

Could you please update your Types plugin and try to resolve your issue.

#1124801

LCR

My issue is resolved now. Thank you!