Skip Navigation

[Resolved] Fatal error when saving field groups

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

Problem:
When saving field groups you see an error:

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

Solution:
Update to the latest Toolset

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
- - 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)

This topic contains 7 replies, has 3 voices.

Last updated by Renier 6 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#1121363

I am trying to: create a new custom field, but upon saving the site 'bombs out'. The custom field slug is created, but the field is not shown afterwards. The following browser error is shown when I try to save the field:
This page isn’t working
vet-portshepstone.co.za is currently unable to handle this request.
HTTP ERROR 500
and the error log give the following error:
[Fri Oct 05 08:22:32.909532 2018] [proxy_fcgi:error] [pid 25792] [client 197.93.156.161:40166] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught InvalidArgumentException in /var/www/vhosts/vet-portshepstone.co.za/httpdocs/wp-content/plugins/types/vendor/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php:28\nStack trace:\n#0 /var/www/vhosts/vet-portshepstone.co.za/httpdocs/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))\n#1 /var/www/vhosts/vet-portshepstone.co.za/httpdocs/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))\n#2 /var/www/vhosts/vet-portshepstone.co.za/httpdocs/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))\n#3 /v...\nPHP message: PHP Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/vet-portshepstone.co.za/:/tmp/) in /var/www/vhosts/vet-portshepstone.co.za/httpdocs/wp-content/plugins/types/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 35\n', referer: hidden link

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

I expected to see: na

Instead, I got: na

I suspect that it has something to do with the temp directory on the server side. I'm not sure if this is a Toolset problem or a server problem. Would like to get more clarity so that I can take the next step.

Please advise on what this error log might mean.

Thank you

#1121384

I have similar reports here:
https://toolset.com/forums/topic/fatal-error-uncaught-invalidargumentexception-first-argument-is-not-a-post/
https://toolset.com/forums/topic/fatal-error-new-post-type-uncaught-invalidargumentexception-first-argument-is/#post-624121
https://toolset.com/forums/topic/500-internal-server-error-when-i-edit-any-post/#post-957334

I miss the steps to replicate those, hence what would help is:
- confirm if that this happens with a fresh set of Toolset
- confirm without other plugins and a native theme, no altered WordPress install
- if all above fails, the steps to replicate this issue, or minimally the steps to replicate them on a copy of your site, if possible
https://toolset.com/faq/provide-supporters-copy-site/

#1121944

I've deployed the site with just Toolset and WooCommerce, with the theme you use.
I headed to this Group and added a single line field:
wp-admin/admin.php?page=wpcf-edit&group_id=2170
It threw upon save:

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

I removed all conditions from the Field Group, re-saved it, and added again a field.
This worked fine.

I started adding conditions again (where to display that field).
This was no issue at all.
That is what I would recommend on the sites where this happens:
- remove all conditions of "Settings for the fields group > Appears on" and then re-save the Field Group.
After, add the conditions again and you should now be able to add fields as you like.

I could not see the issue on other Field Groups, it seems just one.
Can you confirm?
==> On other installs, is it as well just one field group?

That could point to some bug in past versions of the plugin that made the Group settings corrupt and would now be fixed (by re-saving).

#1122970

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.

#1125138
#1127700

Hi Beda and others. Thank you for all your help so far. I'm in the process of updating the site (and others) with the newest hotfix. Please allow me another day or two to test it out. I will let you know how things are going.

#1128088

Sure!

==> In case you will still get reminders to come back here, it's not us, it's the Robot, we cannot control that one.
It will probably ask you in about 2 or 3 days again to comment here.

Thanks!

#1131099

My issue is resolved now. Thank you!