Skip Navigation

[Resolved] Custom fields are empty after saving post

This support ticket is created 3 years, 1 month 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
- 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 12 replies, has 4 voices.

Last updated by Minesh 3 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2381031

I am trying to: Change custom field values

Link to a page where the issue can be seen: hidden link

I expected to see: Custom field values are saved after saving post

Instead, I got: Empty custom fields

#2381151

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I checked on your install and yes I can see the issue. First I try to change the slug from -40 to lazanje but even that does not seems to help.
=> hidden link

*** Please make a FULL BACKUP of your database and website.***
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any difference?

#2381161

Hello Minesh,

I did everything you suggested. The problem is still present.

#2381165

Minesh
Supporter

Languages: English (English )

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

As we do not recommend to debug the issue on production sites. Can you please send me duplicator copy of your site.
- https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#2382091

I'm having trouble making a copy of the site with the plugin you recommend. Can i send you compressed files and database separately?

#2382585

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello

Unfortunately Minesh is off sick today but should be back on Monday to continue assisting you with this one.

Thanks,
Shane

#2383925

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Sorry Branka, Minesh is still off.

Might I suggest you try to create a copy of your site with the All in One WP Migration plugin instead, and share a link to that single backup archive file that creates.

When creating the export archive, update the settings to exclude the media library, and—if it is definitely the case that you have tested the issue with all plugins except for Types disabled and switched to a default theme like twentytwenty—you could also exclude the plugins and themes if needed to make a smaller archive file.

If you still have problems exporting a copy of the site, are you able to provide a staging site that we could use for testing?

#2384371

Minesh
Supporter

Languages: English (English )

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

Could you please try to create copy of your site using ALL in One WP Migration and try to send me link to download your site copy:
=> https://wordpress.org/plugins/all-in-one-wp-migration/

I have set the next reply to private which means only you and I have access to it.

#2384471
#2384693

Minesh
Supporter

Languages: English (English )

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

I found the following error in the debug log file:

[14-Jun-2022 12:55:23 UTC] Greška u bazi WordPressa Duplicate entry '0' for key 'wp_postmeta.PRIMARY' za upit INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (1496, 'wpcf-tip', 'lazanje') koji je postavio/la edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, wpcf_admin_save_post_hook, wpcf_admin_post_save_post_hook, WPCF_Field->save, update_post_meta, update_metadata, add_metadata
 

Then, when I checked the database for both posts and postmeta table I can see the table is having entry with ID 0 and the tables are not set to use auto increment.

To overcome this issue, I suggest please take full backup of your database first.

Once you take full backup of your database, please try to follow the following steps:
- Visit posts table and remove the entry with ID 0
- set ID column as auto increment
- Visit postmeta table and remove the entry with ID 0
- set the meta_id column auto increment

on my localhost where I setup your site the above steps help me to save the custom fields successfully.

#2385357

Could you please provide me export of fixed database?

#2385359

Minesh
Supporter

Languages: English (English )

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

if you can confirm you took full backup of your database then I will try to apply the same settings on your current site.

#2385433

Yes, i have database backup. You can proceed with fix.

#2385499

Minesh
Supporter

Languages: English (English )

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

I've applied the changes to the database table wp_posts and wp_postmeta as described with my previous reply:
=> https://toolset.com/forums/topic/custom-fields-are-empty-after-saving-post/#post-2384693

When I try to save the custom field values, its working. Can you please confirm:
- hidden link