[wp-trac] [WordPress Trac] #25023: WordPress 3.6 deleting data on custom post meta

WordPress Trac noreply at wordpress.org
Wed Aug 28 21:43:47 UTC 2013


#25023: WordPress 3.6 deleting data on custom post meta
----------------------------+--------------------
 Reporter:  cdwharton       |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.6.1
Component:  Administration  |     Version:  3.6
 Severity:  critical        |  Resolution:
 Keywords:                  |
----------------------------+--------------------

Comment (by SergeyBiryukov):

 So, I was trying to find out why this only affects the sample page and not
 any other page that existed before the upgrade.

 My initial thought was that the `wp_save_post_revision()`
 ([source:tags/3.6/wp-includes/revision.php#L598]) is called because the
 sample page doesn't have a revision in the database. However, that's not
 the case, it does have one after we edit the custom field in the meta box
 and update the page. This behaviour is the same for manually created
 pages, there's no difference here.

 The difference is that the sample page text contains `'piña coladas'`
 string ([source:tags/3.6/wp-admin/includes/upgrade.php#L185]). TinyMCE
 turns that into `'piña coladas'`, so the post content becomes different,
 which triggers the `$post_has_changed` flag in `wp_save_post_revision()`
 ([source:tags/3.6/wp-includes/revision.php#L105]), and ultimately leads to
 the `wp_insert_post()` call in `_wp_put_post_revision()`.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25023#comment:34>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list