[wp-trac] [WordPress Trac] #37217: get_network_by_path should use WP_Network_Query

WordPress Trac noreply at wordpress.org
Tue Mar 28 01:22:11 UTC 2017


#37217: get_network_by_path should use WP_Network_Query
--------------------------------------+------------------------
 Reporter:  spacedmonkey              |       Owner:  flixos90
     Type:  enhancement               |      Status:  reopened
 Priority:  normal                    |   Milestone:  4.8
Component:  Networks and Sites        |     Version:  4.6
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------
Changes (by jeremyfelt):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 In [40102], we introduced a test and data provider that asserts a series
 of conditions that would fit a configuration in which path segments are
 limited to `0`. However, instead of filtering the path segments, we force
 `$using_paths` to `0`, which doesn't limit the search to single path
 segments, but ignores paths entirely when doing the database lookup. The
 results from this query can be unpredictable with the assigned data
 provider. This was causing an issue in my local environment when running
 tests with an object cache enabled.

 [attachment:37217.5.diff] adjusts the test to filter the network path
 segments count to `0`, which makes these tests more predictable. This also
 allows us to always run the test rather than only in an object cache
 configuration.

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


More information about the wp-trac mailing list