[wp-hackers] Missing postmeta after 3.6 upgrade

Josh joshua.sibelman at gmail.com
Tue Aug 6 21:27:37 UTC 2013


OK, here it is. 

I should mention that we have filters on save_post and wp_restore_post_revision for both storing and retrieving postmeta with revisions.

-------------------------------------

We use a plugin to generate our custom post types with their respective meta fields. Someone else on my team noticed the postmeta disappearing from posts in the wp-admin. When reviewing the revision history we would see two revisions about a week old, only a few seconds apart, from two different authors, neither of whom actually made revisions at that time (we know this because of who the author accounts belong to and when the data disappeared). Restoring one of the old revisions would restore the meta fields, after which we would no longer see them disappearing on subsequent clicks into the given record.

As a test we picked another record with postmeta, and I looked at its rows in the database using Sequel Pro. The expected metafields were listed in the postmeta table. Upon clicking the record in wp-admin to edit it, the postmeta was gone. I noted the two post IDs of the two revisions that appeared in the list after clicking on the record. The most recent of the two had rows in postmeta where the meta key was set with the field's label and a blank meta value, and the older of the two (by about 30 seconds) had both the correct meta key and meta value stored.

When we saw the two revisions belonging to two different users we speculated that the problem might somehow be related to this personal revision history feature.

Our workflow is a little atypical. We have a staging server and a production server, with content editors doing their work on staging and using the RAMP plugin from Crowd Favorite to push content to the production server. I logged into the wp-admin of our production server where almost none of the posts have revision histories and didn't see this behavior replicated where the postmeta was being deleted.

In order to test our hypothesis I set up a new db schema, took the production data and imported it, then deleted all of the revisions from the posts table along with their attendant metadata from postmeta. I updated wp-config.php to use the new schema and no longer saw the issue of disappearing postmeta.



On Tuesday, August 6, 2013 at 1:47 PM, Mickey Panayiotakis wrote:

> Subject: Re: [wp-hackers] Missing postmeta after 3.6 upgrade
> Message-ID: <B293922ADC9140CEA5DEF188603525B8 at gmail.com (mailto:B293922ADC9140CEA5DEF188603525B8 at gmail.com)>
> Content-Type: text/plain; charset="utf-8"
> 
> I'd love to see the details, on this list or off.
> 
> > The complete explanation of what we were encountering is somewhat
> lengthy and will require a lot of verbiage. Is this something I should
> email to you off-list? Or shall I post it here?
> 
> 
> 
> 
> 
> --
> 
> Mickey Panayiotakis
> Managing Partner
> 800.270.5170 x512
> <http://www.infamia.com>
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 




More information about the wp-hackers mailing list