[wp-trac] [WordPress Trac] #41039: `_delete_option_fresh_site()` continually queries the database

WordPress Trac noreply at wordpress.org
Sat Aug 12 23:57:43 UTC 2017


#41039: `_delete_option_fresh_site()` continually queries the database
--------------------------+-----------------------
 Reporter:  dlh           |       Owner:  dlh
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  4.9
Component:  Customize     |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------
Changes (by dlh):

 * keywords:  has-patch reporter-feedback => has-patch


Comment:

 @westonruter I think the second assertion passes when the patch isn't
 applied because the integer `0` is still cached after `do_action(
 'customize_save_after' )` was called for the first assertion.

 When `update_option()` runs as part of the second `do_action(
 'customize_save_after' )`, `get_option()` retrieves the cached integer,
 and the `===` test in `update_option()` passes.

 [attachment:41039.2.diff] updates the test to regenerate the `alloptions`
 cache between assertions, which causes the second assertion to fail
 without the change to `_delete_option_fresh_site()`.

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


More information about the wp-trac mailing list