[wp-trac] [WordPress Trac] #37697: Strange behavior with thumbnails on preview in 4.6

WordPress Trac noreply at wordpress.org
Wed Aug 17 22:03:47 UTC 2016


#37697: Strange behavior with thumbnails on preview in 4.6
-------------------------------------------------+-------------------------
 Reporter:  jbenton                              |       Owner:  joemcgill
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  high                                 |   Milestone:  4.6.1
Component:  Post Thumbnails                      |     Version:  4.6
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing has-patch has-unit-    |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by swissspidy):

 * keywords:  needs-testing => needs-testing has-patch has-unit-tests


Comment:

 There needs to be a unit test showing the effect of the additional
 `$post_id != $_REQUEST['preview_id']` check.

 In [attachment:37697.2.diff] I added second unit test to demonstrate the
 fixed behaviour. I also added an `empty( $_REQUEST['preview_id'] )` check
 to `_wp_preview_post_thumbnail_filter()` and simplified the tests a bit.

 * resets inside the tests should happen before the assertions. If an
 assertion fails, the following could won't be called
 * simply doing `$GLOBALS['post'] = $old_post; ` should be enough there

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37697#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list