Skip Navigation

[Resolved] fatal error new post type "Uncaught InvalidArgumentException: First argument is

This support ticket is created 6 years, 9 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.

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)

This topic contains 14 replies, has 3 voices.

Last updated by Beda 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#623098
2018-03-07_16h01_42.png

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

#623103
2018-03-07_16h15_04.png

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.

#623160

Minesh
Supporter

Languages: English (English )

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

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?

#623398

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!

#623515

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!

#623528

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

#623596

Minesh
Supporter

Languages: English (English )

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

Did you clean up the Database - have you tried with fresh/clean WordPress installation?

#623702

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.

#623709

Minesh
Supporter

Languages: English (English )

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

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/

#623730

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

#623746

Minesh
Supporter

Languages: English (English )

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

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?

#623758

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?

#623764

Minesh
Supporter

Languages: English (English )

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

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.

#624121

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

#1125136