[wp-trac] [WordPress Trac] #46125: No cache cleanup after populate_options action call

WordPress Trac noreply at wordpress.org
Mon Jan 28 14:59:23 UTC 2019


#46125: No cache cleanup after populate_options action call
--------------------------------+-----------------------------
 Reporter:  david.binda         |      Owner:  (none)
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 With the refactoring of new site creation, there seems to be a backward
 incompatibility being introduced.

 Previously, calling `get_blog_details` from within `populate_options`
 action callback, created a cache, which got properly purged, which does
 not seem to be the case anymore.

 Hooking a callback to `populate_options` which calls `get_blog_details`
 caches the blog's values at the state at which those are prior the options
 population - eg.: `false` for `siteurl`.

 Seems like it can be fixed by calling `clean_blog_cache` right after the
 `populate_options` in the `wp_initialize_site` function, which was the
 case prior the refactor.

 I'm attaching a unit test covering such behaviour and a patch for this
 backward compatibility breaking change.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46125>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list