Could you clarify a couple things regarding database content please?
Firstly, I've noticed that in the postmeta tables, the values for meta_key _wp_types_group_templates is either all or just a varying number of commas. I find the commas a bit odd! What do they mean please?
Secondly, I've noticed that even when I completely remove one or more custom fields, they're not cleared from the serialized data (meta_key is _cred_extra) for any forms that exist for the post type they were originally assigned to. Is this expected?
Thanks
Hi, I don't personally know the answers to these questions but I have asked my 2nd tier team if they have that information available. Hopefully I'll have some feedback tomorrow.
Okay I have some answers.
Firstly, I've noticed that in the postmeta tables, the values for meta_key _wp_types_group_templates is either all or just a varying number of commas. I find the commas a bit odd! What do they mean please?
The value should be either "all" or a comma-surrounded and comma-separated list of Content Template slugs where the corresponding Field Group should appear, like this:
,unassigned-temp,guest-pages,pages,
If you're seeing all commas and no slugs, then that could be a result of data corruption or a bug in import/export that was resolved in a previous version of Types. Regardless, it behaves essentially the same as "all" though somewhat less performant. If you want to clean those up you can edit the corresponding field group in wp-admin (the field group numeric ID is post_id in the postmeta table), Click "Edit" in the "Appears On" setting, and check one checkbox that is currently unchecked. Save the Field Group, then edit it again and uncheck that checkbox you just changed. The values for this field group should update properly in the database. If they don't we can take a closer look.
I've noticed that even when I completely remove one or more custom fields, they're not cleared from the serialized data (meta_key is _cred_extra) for any forms that exist for the post type they were originally assigned to. Is this expected?
Yes, until the Form is saved again without the deleted custom field, the deleted custom field information will remain in the serialized data structure. If you resave the Form without the field in the form contents, the serialized data structure will be updated to remove the deleted field.
Hi christian
thanks for this information. I've followed your instructions and the commas have now been cleaned up and the serialized data no longer contains the previously deleted fields.
Just one last question; since I needed to save the post forms again to clean up the serialized data after deletion of custom fields, do I need to re-save affected forms when new custom fields are ADDED to a post type (in order to add the new fields to the serialized data)?
There's no need to add the new fields to the serialized data unless you also add those fields in the Form builder. In that case, yes, you would resave the Form. Otherwise no, it's not necessary.
My issue is resolved now. Thank you!