Home › Toolset Professional Support › [Resolved] fatal error new post type "Uncaught InvalidArgumentException: First argument is
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.
Our next available supporter will start replying to tickets in about 6.79 hours from now. Thank you for your understanding.
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)
Tagged: Setting up custom types, Types plugin
Related documentation:
This topic contains 14 replies, has 3 voices.
Last updated by Beda 6 years, 1 month ago.
Assisted by: Minesh.
I am trying to: create a new post type
Link to a page where the issue can be seen: hidden link
I expected to see: the page to add a new post type
Instead, I got:
Fatal error: Uncaught InvalidArgumentException: First argument is not a post. in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php:60 Stack trace: #0 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php(41): Toolset_Field_Group->__construct(NULL) #1 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(158): Toolset_Field_Group_Post->__construct(NULL) #2 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php(106): wpcf_add_meta_boxes('post_type', Object(WP_Post)) #3 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(286): wpcf_admin_add_meta_boxes('post_type', NULL) #4 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/wp_52xvca/trextools.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/wp_52xvca/trextools.com in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php on line 60
In case it is relevant, prior to install of the beta version, I deleted all custom post types, taxonomies, views, and layouts.
I am able to open certain pages, but when I go to "Relationships" and am prompted to migrate, I get this error:
> Post relationships migration started.
> Dropped table "wp_996sku_toolset_associations".
> Dropped table "wp_996sku_toolset_relationships".
> Dropped table "wp_996sku_toolset_type_sets".
> The toolset_associations table created.
> Post relationships migration started.
> Dropped table "wp_996sku_toolset_associations".
> Dropped table "wp_996sku_toolset_relationships".
> Dropped table "wp_996sku_toolset_type_sets".
> The toolset_associations table created.
Hello. Thank you for contacting the Toolset support.
Well - I would like to know what exact steps you followed before installing the new Beta - Did you removed all CPT created using Types?
Is there any relationship created before you deleted the CPT?
Hello,
Thanks for the reply.
I deleted all CPT, taxonomies, custom fields, layouts and views except the ones that are standard to WP.
I then deactivated the toolset types, view and layout plugins. Then I deleted them. Then I added the beta plugins by uploading the zip files one by one: first types, then views, then CRED.
Thanks for any help!
I ended up having to reinstall wordpress, guessing it was some sort of conflict with a plugin or just dirt in the DB from testing many plugins. it's working now, so far, thanks!
Hi,
Unfortunately, a similar error is back. I created a couple CPTs and relationships to play with things (one many-to-many and one one-to-many). I then deleted those relationships. After doing so, I get this error when I try to create a new CPT or edit any CPT I had created:
Fatal error: Uncaught InvalidArgumentException: First argument is not a post. in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php:60 Stack trace: #0 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php(41): Toolset_Field_Group->__construct(NULL) #1 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(158): Toolset_Field_Group_Post->__construct(NULL) #2 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php(106): wpcf_add_meta_boxes('post_type', Object(WP_Post)) #3 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(286): wpcf_admin_add_meta_boxes('post_type', NULL) #4 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/wp_52xvca/trextools.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/wp_52xvca/trextools.com in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php on line 60
I am able to add relationships back, but when I then go to add a new instance of a CPT (eg CPT = Person, Add New Person) I get this error:
Fatal error: Uncaught InvalidArgumentException: First argument is not a post. in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php:60 Stack trace: #0 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php(41): Toolset_Field_Group->__construct(NULL) #1 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(158): Toolset_Field_Group_Post->__construct(NULL) #2 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php(106): wpcf_add_meta_boxes('person', Object(WP_Post)) #3 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(286): wpcf_admin_add_meta_boxes('person', Object(WP_Post)) #4 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/wp_52xvca/trextools.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/wp_52xvca/trextool in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php on line 60
Did you clean up the Database - have you tried with fresh/clean WordPress installation?
Yes. I installed WordPress from scratch and it was working. Then, when I deleted two relationships I had created, it stopped working. I will run the DB cleaner to see if that fixes the error.
I would suggest to install fresh WP install and we just release new Types beta version 2.3-b5.
You can download it from following link - Select "Beta" from "Choose channel: " dropdown:
https://toolset.com/account/downloads/
I cleaned the DB, it did not fix the error. I updated the beta version installed, same error.
Fatal error: Uncaught InvalidArgumentException: First argument is not a post. in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php:60 Stack trace: #0 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php(41): Toolset_Field_Group->__construct(NULL) #1 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(158): Toolset_Field_Group_Post->__construct(NULL) #2 /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php(106): wpcf_add_meta_boxes('post_type', Object(WP_Post)) #3 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(286): wpcf_admin_add_meta_boxes('post_type', NULL) #4 /home/wp_52xvca/trextools.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/wp_52xvca/trextools.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/wp_52xvca/trextools.com in /home/wp_52xvca/trextools.com/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php on line 60
Well - if it's a fresh install I wonder why you getting error:
Have you try following steps:
- Download wordpress from http://www.wordpress.org
- Install fresh wordpress installation
- download latest Types Beta - You can download it from following link - Select "Beta" from "Choose channel: " dropdown:
=> https://toolset.com/account/downloads/
- install Beta plugin on this fresh install and activate it
- Create your content and post relationship
Does this helps?
Yes, in short, I did that yesterday, effectively, and it was working, and then stopped.
In more detail, I have WordPress installed through the host DreamHost (not via download from wordpress.org). Yesterday, I spoke with DreamHost support and had my wordpress install completely deleted, including all databases. Then DreamHost support re-installed wordpress. As I described earlier, I installed the betas plus Layouts v 2.2 Everything was working fine. I then deleted two relationships I had created and the error returned. This morning, I've run the DB cleaner, updated the Types beta, as suggested, but the error is still occurring.
I'm hesitant to re-install wordpress again, unless there is reason to think downloading it and manual install might make a difference or that a fresh install with the types beta released yesterday (2.3-b5) will make a difference. What do you think?
I'm hesitant to re-install wordpress again, unless there is reason to think downloading it and manual install might make a difference or that a fresh install with the types beta released yesterday (2.3-b5) will make a difference. What do you think?
==> Yes - it might make a difference as its Beta so we are not sure from where the issue is occurring. If you try once again with fresh install and check at what point it stucks we are happy to debug this issue further.
Do not install Layouts plugin for now - install Types and views beta for now and check if that helps and if its working then install the Layouts plugin.
With the wordpress manual install, I'm not yet having any problems with the fatal error. I've got a new issue (edits to Views are not saving, which I'll start a separate ticket about).
This was a bug and is now solved.
https://toolset.com/download/toolset-types/#changelog
https://toolset.com/forums/topic/uncaught-exception-invalidargumentexception-vendor-toolset-toolset-common-inc/#post-1124532
If you still experience this very issue, could you open a new ticket?