Support Forum
Support › Meta Box Builder › Can't save location for custom field groups, always reverts to POSTSResolved
Using Meta Box Builder + Meta Box Group + MB Custom Post Type (I have MB AIO), I edited a custom field group, and after I saved it the "location" reverted to "POSTS" -- when before it had been set to appear for other custom post types. I tried to change the locations again, but every time I hit save and go back to look at the locations, it is always reverting to POST.
I need to get this fixed ASAP, because I can not make the adjustments I need when I can't see these options in the correct post types I am editing. I'm sure there have been several updates to metabox AIO since the last time I edited these, but I can't point to a clear time when this may have stopped working.
Note that I used to be able to do this with no problem, so it is a new issue.
I tried deactivating all plugins and using default WP theme but no success.
My WP (5.8.2) and plugins are all up to date, but here is the list just in case:
Advanced Editor Tools Version 5.6.0
Akismet Anti-Spam Version 4.2.1
Classic Editor Version 1.6.2
Contact Form 7 Version 5.5.2
Duplicate Page Version 4.4.5
ManageWP - Worker Version 4.9.10
Meta Box Version 5.4.8
Meta Box AIO Version 1.15.2
No Category Base (WPML) Version 1.3
UpdraftPlus - Backup/Restore Version 1.16.63
W3 Total Cache Version 2.2.0
Wordfence Security Version 7.5.7
WordPress Importer Version 0.7
WP Database Backup Version 5.8.1
Here are screenshots, the first one shows what is keeps defaulting to after I save, and the second one shows the custom post types I am trying to change to.
Hi,
I have had an experience with a similar issue before, the way to resolve it is to create a new field group and assign the post type. Can you please confirm that works?
Yes I confirmed it works, but are you serious? This is not a bug that needs to be fixed? The particular group I need to update has like 75 different options, it would take me hours to rebuild it.
Hi,
Can you please export that field group and share it here? I will import it to my demo site and check the issue.
https://docs.metabox.io/extensions/meta-box-builder/#export--import
It seems like I have this issue on 1 site. Any update/resolution? I also have a complex field group, which I'd rather not recreate.
I can confirm, when saving in MB builder, the postmeta "settings" for this field group is set to "a:0:{}"
If I copy the "settings" value from another field group (see below) the UI displays correct. But upon saving, gets reset/cleared.
a:11:{s:11:"object_type";s:4:"post";s:10:"post_types";a:1:{i:0;s:7:"invoice";}s:7:"context";s:6:"normal";s:8:"priority";s:4:"high";s:5:"style";s:7:"default";s:9:"tab_style";s:0:"";s:18:"tab_default_active";s:0:"";s:5:"class";s:0:"";s:6:"prefix";s:0:"";s:11:"text_domain";s:16:"your-text-domain";s:13:"function_name";s:25:"your_prefix_function_name";}
Fortunately the postmeta "fields" seems to be saved ok. Just not the settings.
I can send the fields by email, if it helps?
I tested a bit more. My temporary work-around was to delete an unneeded field. Then for some reason it saved the fieldgroup "settings" fine. This worked by deleting either a text or heading field.
But it would not let me first save a new field, to then delete. Not sure why. So something about the stored value of the fields
, causing the settings
not to save?
If it helps, this is a site which I have not used builder for a long time, probably since before the UI change.
It happens to me also, but only on homepage and every time when I have more than 6-7 tabs in main Field group, maybe because the structure is more complicated, don't know. I love Metabox, use it daily but right now its unusable for me for any serious project, because this bug waste my time (tried to solve this by recreating the structure countless times... took me more than 10 hours, no results.
Hi,
You can try to follow this tutorial to increase the PHP setting max_input_vars
to fix the issue
https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/
Let me know how it goes.
You can try to follow this tutorial to increase the PHP setting max_input_vars to fix the issue
https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/
Wowow, thank you.
This was the issue for me on a couple sites. Makes sense because I couldn't track it to any other variable, despite many hours trying.
Maybe it's obvious, but I want to add:
If using Builder, make sure to re-save your Field Group "Settings" such as the post type.
Because when attempting to save (with insufficient max_input_vars
) something is corrupted, resulting in invalid EXPORT code also.
Devs: is it possible to make the save FAIL or give a warning, instead of doing what appears to be a partial save (thus corrupting the Field Group settings + export (php & json))?
This is such a devastating issue to run into, because it only affects sites with many fields– although I wouldn't consider the fields I'm using to be incredibly complex. On my latest site, I'm not even using groups.
Like others I tried many workarounds which were not reliably successful.
If you haven't already it probably deserves a big fat WARNING on the Builder docs page...
Are there other ways to mitigate this issue moving forward? Maybe deleting unused fields before submission? I don't know, it's a bit over my head.
I'm relieved that I know the cause now. Thank you again.