[wp-trac] [WordPress Trac] #34798: Export Bug
WordPress Trac
noreply at wordpress.org
Fri Nov 27 05:00:45 UTC 2015
#34798: Export Bug
--------------------------+-----------------------------
Reporter: eugenekireev | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Export | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
We found a bug in export process that prevents post data changes going to
actual export.
In wp\wp-admin\includes\export.php L416 you select all matching posts from
DB, having $posts array of stdClass objects as result. Then you call
setup_postdata for every post, that goes to wp\wo-includes\query.php
setup_postdata which calls $wp_query->setup_postdata after passing the
$post.
In function setup_postdata L4754 you check instance of the $post which
will always be stdClass and create a new $post object. It breaks the
reference link original $post from export.php so all changes in function
setup_postdata will not be reflected to original object.
A possible fix would be converting $post object to WP_Post before calling
setup_postdata in expost.php Please see patch attached
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34798>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list