Discussion:
Missing postmeta after 3.6 upgrade
Josh
2013-08-05 21:35:23 UTC
Permalink
Hi all,

We just started noticing blank meta fields for several custom post types after upgrading to 3.6. I've been reading that 3.6 made some big changes to how autosave is handled and to me this looks like behavior I've seen before with autosave wiping out postmeta. Has anyone else noticed this happening?

Thanks,
Josh
Alex Rayan
2013-08-05 22:44:10 UTC
Permalink
Hi Josh,
I have a few plugins with custom post types that add meta data to a post on
"publish_[custom_post_type]" action. I've tested them with 3.6 and haven't
noticed any issues with meta data being wiped out.
How are you recording meta data for your custom posts? On which action?

Best regards,
Alex
Post by Josh
Hi all,
We just started noticing blank meta fields for several custom post types
after upgrading to 3.6. I've been reading that 3.6 made some big changes to
how autosave is handled and to me this looks like behavior I've seen
before with autosave wiping out postmeta. Has anyone else noticed this
happening?
Thanks,
Josh
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Josh
2013-08-05 23:17:18 UTC
Permalink
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.

If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
Post by Alex Rayan
Hi Josh,
I have a few plugins with custom post types that add meta data to a post on
"publish_[custom_post_type]" action. I've tested them with 3.6 and haven't
noticed any issues with meta data being wiped out.
How are you recording meta data for your custom posts? On which action?
Best regards,
Alex
Post by Josh
Hi all,
We just started noticing blank meta fields for several custom post types
after upgrading to 3.6. I've been reading that 3.6 made some big changes to
how autosave is handled and to me this looks like behavior I've seen
before with autosave wiping out postmeta. Has anyone else noticed this
happening?
Thanks,
Josh
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Josh
2013-08-06 00:10:18 UTC
Permalink
FYI, I reverted back to WP 3.5.2 and the problem ceased. Seems like this must be a bug in 3.6 with the new revisions tool.
Post by Josh
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.
If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
Post by Alex Rayan
Hi Josh,
I have a few plugins with custom post types that add meta data to a post on
"publish_[custom_post_type]" action. I've tested them with 3.6 and haven't
noticed any issues with meta data being wiped out.
How are you recording meta data for your custom posts? On which action?
Best regards,
Alex
Post by Josh
Hi all,
We just started noticing blank meta fields for several custom post types
after upgrading to 3.6. I've been reading that 3.6 made some big changes to
how autosave is handled and to me this looks like behavior I've seen
before with autosave wiping out postmeta. Has anyone else noticed this
happening?
Thanks,
Josh
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Otto
2013-08-06 00:39:07 UTC
Permalink
If you disable plugins entirely, then any postmeta info which doesn't
start with an underscore should still be visible in the "Custom
fields" box. Does the data disappear when this is the case as well?

Basically, try to figure out if it's the interaction between 3.6 and a
plugin by disabling all plugins and seeing if it happens on a clean
setup.

-Otto
Post by Josh
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.
If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
Daniel
2013-08-06 02:44:15 UTC
Permalink
Something else, try a on a fresh install of WordPress with a clean
database in-case something in the database is causing issues.
Post by Otto
If you disable plugins entirely, then any postmeta info which doesn't
start with an underscore should still be visible in the "Custom
fields" box. Does the data disappear when this is the case as well?
Basically, try to figure out if it's the interaction between 3.6 and a
plugin by disabling all plugins and seeing if it happens on a clean
setup.
-Otto
Post by Josh
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.
If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Josh
2013-08-06 16:09:48 UTC
Permalink
Thanks for the suggestion Daniel, this is what I'm going to try today. I'm going to insert all the records minus the post revisions and see if the same behavior is displayed.
Post by Daniel
Something else, try a on a fresh install of WordPress with a clean
database in-case something in the database is causing issues.
Post by Otto
If you disable plugins entirely, then any postmeta info which doesn't
start with an underscore should still be visible in the "Custom
fields" box. Does the data disappear when this is the case as well?
Basically, try to figure out if it's the interaction between 3.6 and a
plugin by disabling all plugins and seeing if it happens on a clean
setup.
-Otto
Post by Josh
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.
If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Josh
2013-08-06 18:08:39 UTC
Permalink
So that worked. What I did was export the WP database, import it into a new schema, deleted all post revisions with their respective postmeta, and then updated wp-config.php to point to the new schema. That fixed the problem of the vanishing postmeta.

To me this sounds like a bug with the new revision system, but the Codex suggests getting feedback before opening a ticket by emailing this list, among other things.

Anyone have feedback about filing this as a ticket?
Post by Daniel
Something else, try a on a fresh install of WordPress with a clean
database in-case something in the database is causing issues.
Post by Otto
If you disable plugins entirely, then any postmeta info which doesn't
start with an underscore should still be visible in the "Custom
fields" box. Does the data disappear when this is the case as well?
Basically, try to figure out if it's the interaction between 3.6 and a
plugin by disabling all plugins and seeing if it happens on a clean
setup.
-Otto
Post by Josh
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.
If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Andrew Nacin
2013-08-06 18:17:58 UTC
Permalink
Post by Josh
So that worked. What I did was export the WP database, import it into a
new schema, deleted all post revisions with their respective postmeta, and
then updated wp-config.php to point to the new schema. That fixed the
problem of the vanishing postmeta.
To me this sounds like a bug with the new revision system, but the Codex
suggests getting feedback before opening a ticket by emailing this list,
among other things.
Anyone have feedback about filing this as a ticket?
Steps to reproduce would be great. Deleting data is a critical bug and
deleting postmeta is also highly noticeable, yet this is the only report
I've seen, despite 1.5 million downloads and the 3.6 codebase having been
running on WordPress.com for months.

I'm not saying it isn't happening to you, I'm just saying it's certainly
not happening for everyone, so we'd need to figure out why.

Andrew
Josh
2013-08-06 18:24:26 UTC
Permalink
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?
Post by Andrew Nacin
Post by Josh
So that worked. What I did was export the WP database, import it into a
new schema, deleted all post revisions with their respective postmeta, and
then updated wp-config.php to point to the new schema. That fixed the
problem of the vanishing postmeta.
To me this sounds like a bug with the new revision system, but the Codex
suggests getting feedback before opening a ticket by emailing this list,
among other things.
Anyone have feedback about filing this as a ticket?
Steps to reproduce would be great. Deleting data is a critical bug and
deleting postmeta is also highly noticeable, yet this is the only report
I've seen, despite 1.5 million downloads and the 3.6 codebase having been
running on WordPress.com (http://WordPress.com) for months.
I'm not saying it isn't happening to you, I'm just saying it's certainly
not happening for everyone, so we'd need to figure out why.
Andrew
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Josh
2013-08-06 16:08:50 UTC
Permalink
Thanks for the response Otto. I am actually using Sequel Pro to check the records in the database as opposed to the WP interface. I don't believe it's a plugin causing the issue, as a second WP instance isn't having this problem. The difference between the two instances is that the one having the issue is the one that users interact with, which leads me to believe this is related to the changes made to the post revision system.
Post by Otto
If you disable plugins entirely, then any postmeta info which doesn't
start with an underscore should still be visible in the "Custom
fields" box. Does the data disappear when this is the case as well?
Basically, try to figure out if it's the interaction between 3.6 and a
plugin by disabling all plugins and seeing if it happens on a clean
setup.
-Otto
Post by Josh
It's kind of a weird issue to explain. It occurs when clicking on a post to edit it. Clicking on a post to edit brings up the edit post screen, where the postmeta fields are then blank. Looking at the database the postmeta is in the postmeta table, but once I click on the record to edit it, once the edit screen loads the postmeda fields are gone from the db. It's as though some action is being called upon loading the edit screen that is deleting the post meta. Definitely a head scratcher.
If I restore the post to a previous state via an available autosave or revision then the postmeta is restored, and subsequent clicks to edit the record do not cause the postmeta to be deleted.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Mickey Panayiotakis
2013-08-06 20:47:16 UTC
Permalink
Subject: Re: [wp-hackers] Missing postmeta after 3.6 upgrade
Message-ID: <***@gmail.com>
Content-Type: text/plain; charset="utf-8"

I'd love to see the details, on this list or off.
Post by Josh
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>
Josh
2013-08-06 21:27:37 UTC
Permalink
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.
Post by Mickey Panayiotakis
Subject: Re: [wp-hackers] Missing postmeta after 3.6 upgrade
Content-Type: text/plain; charset="utf-8"
I'd love to see the details, on this list or off.
Post by Josh
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
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...