Make WordPress Core

Opened 3 years ago

Closed 8 months ago

#37226 closed defect (bug) (invalid)

Main Publish/Update button is updating also custom meta fields.

Reported by: Er_eri Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.3
Component: General Keywords:
Focuses: Cc:
PR Number:


This issue is affecting plugins that uses ajax to update values. I have a custom meta box to update post custom meta with ajax. If i have to update the content and the meta value (with ajax) at the same time, the main Publish/Update button is ignoring previous value saved with ajax. In order to save meta value with ajax, i have to update the value and then refresh the page, to update the content.
Is also affecting "post_views_count" plugin. If i have to edit an old post, and while updating, the post has new views, after i hit Update button, will ignore the new views of the post and will save the old number of views.
If there is already a small Update button on Custom Fields that updates meta value with ajax, the main Publish/Update button shouldn't update the meta fields.

Attachments (1)

custom meta.jpg (91.4 KB) - added by Er_eri 3 years ago.

Download all attachments as: .zip

Change History (2)

3 years ago

#1 @desrosj
8 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hi @Er_eri,

Thank you for opening this ticket, and welcome to Trac! My apologies that it took so long for you to receive a response.

It seems like you are describing a race condition. Unfortunately, there is no way to "version" meta values to ensure this does not happen. You will need to account for this in your code.

Note: See TracTickets for help on using tickets.