Skip Navigation

[Resolved] Deleting custom fields group creates a 500 error

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

Problem: I see a 500 error message when editing or creating a post after I delete or rename a custom field group. The error log says "PHP Fatal error: Uncaught InvalidArgumentException: First argument is not a post."

Solution: Flush the site's object cache.

This support ticket is created 6 years 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by charlesB-5 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#1176144

After deleting a custom filed group or renaming a custom field group we get a 500 error message when trying to view or create a post.

Here is a sample of the log error when renaming the custom fields.

PHP Fatal error: Uncaught InvalidArgumentException: First argument is not a post. in /mv4-1/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group.php:60 Stack trace: #0 /mv4-1/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/post.php(41): Toolset_Field_Group->__construct(NULL) #1 /mv4-1/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php(158): Toolset_Field_Group_Post->__construct(NULL) #2 /mv4-1/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php(107): wpcf_add_meta_boxes('mot', Object(WP_Post)) #3 /wordpress/core/5.0.2/wp-includes/class-wp-hook.php(286): wpcf_admin_add_meta_boxes('mot', Object(WP_Post)) #4 /wordpress/core/5.0.2/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #5 /wordpress/core/5.0.2/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /wordpress/core/5.0.2/wp-admin/includes/meta-boxes.php(1416): do_action('add_meta_boxes', 'mot', Object(WP_Post))

#1176184
Screen Shot 2019-01-02 at 11.36.30 AM.png

Is it possible for you to temporarily remove, deactivate or otherwise flush this object caching system on your site? I think this may be related to another one of your tickets as well: https://toolset.com/forums/topic/split-split-table-field-field-group-title-its-not-saved/

Let me know what you find out.

#1176206

Purging the site cache seems to have solved the issue. Thank you for pointing us in the right direction.

#1176291

Great, let me know if you have any additional concerns about that.

#1179291
Screen Shot 2019-01-07 at 9.26.33 AM.jpg

Purging works fine. No more issues.
One additional question: I created a custom filed/ post reference. The posts I want to reference to (and only show the title) are from the same post type (Mots) but "Mots" is the only post type that is grey out and can't be selected.
How can I go around this?

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/post-reference-in-the-same-post-type/

#1179301

I've split your new question into a separate ticket, and I will follow up there shortly.

#1179341

My issue is resolved now. Thank you!

#1180090

Just checking on the new separate ticket. Thank you.