Hi, I have a custom post type called 'producers'. New posts are created via a front end form submission. All has been working well, but my client has told me that some of the fields are now empty, whereas they previously contained data.
I've verified this, and I can see the data in the database, but it no longer shows in the post. Newer posts seem to be unaffected by this.
You can see this video for more details:
I also posted some screenshots in this facebook post:
What I need to know in the short term, is how can I get the data in the database to display in the post again? How to prevent this from happening in the future?
Please share your site credentials via this contact form https://metabox.io/contact/
I will take a look.
Admin login link sent. Thanks.
I understand the issue. The field ID in the builder is
product_description but in the database, it is
product_description:, notice the colon character
I correct the field ID in the database and it shows when editing the post as well. Screenshot https://imgur.com/a/AzX9x0v
Many thanks for finding that! I do remember changing the field to remove the ':' a while back, so that explains the cause. Couple of questions:
- should the field name not have updated the database automatically?
- what do I need to edit in the database to get the fields back? If I change product_description: to product_descripton (i.e. just remove the 🙂 from the product_details meta key (the second screenshot you shared), then nothing shows within the post at all.
The smiley above should be : )
should the field name not have updated the database automatically?
No. After creating the fields in the builder or registering with code, it helps you to show the field appearance on loading, there isn't any value in the database. You need to add something to the field and save the post to save the field value to the database.
what do I need to edit in the database to get the fields back?
You will need to use some custom code to update the field ID in the database. Please read more in this topic https://support.metabox.io/topic/update_post_meta-for-cloneable-group-fields/
If you cannot complete the task, you can contact us here https://metabox.io/contact/
We offer a customization service with an extra fee.