Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#36760 new defect (bug)

Intermittent empty returns from get_post_meta function after 4.5 upgrade

Reported by: amberau's profile amberau Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5
Component: Options, Meta APIs Keywords: needs-patch
Focuses: Cc:


I've seen this reported several times, but the reporters failed to properly explain the issue and the tickets were closed.

Since the 4.5 upgrade I am seeing intermittent issues in my custom plugin (which has worked for years and hasn't changed) where the get_post_meta function is used if the request is made via ajax or by calling a custom endpoint. Rolling back the 4.5 upgrade has resolved these issues.

The same function called with exactly the same arguments will return the meta data value one minute and return an empty string the next (with single on). The data in the database is unchanged. Logging shows the post id and meta key are the same, only the return value is different. It always seems to work as part of a regular page request (not ajax, not custom endpoint).

Sometimes the function works correctly for 24 hours, then fails several times. I can't identify any pattern but suspect the meta cache / session. I tried doing a meta cache update for the object before calling get_post_meta, but the problem still occurred.

In Googling I've found several people reporting issues related to get_post_meta after the 4.5 update. Please take a look!

Change History (3)

#1 @DrewAPicture
8 years ago

  • Component changed from Posts, Post Types to Options, Meta APIs

#2 @MikeHansenMe
8 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

#3 @MikeHansenMe
8 years ago

We need to reproduce this so we can determine what is happening and patch it.

Note: See TracTickets for help on using tickets.