[wp-trac] [WordPress Trac] #47599: Return for short circuits for multisite classes.

WordPress Trac noreply at wordpress.org
Tue Aug 6 21:58:35 UTC 2019


#47599: Return for short circuits for multisite classes.
----------------------------------------+------------------------------
 Reporter:  spacedmonkey                |       Owner:  adamsilverstein
     Type:  defect (bug)                |      Status:  assigned
 Priority:  normal                      |   Milestone:  5.3
Component:  Networks and Sites          |     Version:  5.2
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  multisite
----------------------------------------+------------------------------

Comment (by adamsilverstein):

 Question from @felipeelia related -
 https://core.trac.wordpress.org/ticket/45800#comment:21

 Should we really be setting `$this->sites` here? before the filter
 depending on the query this could be set to ids, full objects  or nothing
 (for a count request). Since we pass a reference to `$this` in the filter,
 maybe we should leave it up to filter consumers to set `$this->sites`?

 In [attachment:"47599.2.diff"] I updated our existing unit tests to
 account for requesting full objects not just ids. in this case previously
 additional database requests were made and the tests fail. after this
 patch the tests pass - no additional queries are run when a non null value
 is returned from the filter.

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


More information about the wp-trac mailing list