Opened 9 years ago
Last modified 7 years ago
#34798 new defect (bug)
Export Bug
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Export | Keywords: | has-patch dev-feedback needs-refresh |
Focuses: | Cc: |
Description
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
Thanks you so much @eugenekireev for your first ticket. I am sorry if its not done yet. @swissspidy could you please confirm what happens afterward?