[wp-trac] [WordPress Trac] #31149: Error Object of class stdClass could not be converted to int in ms-functions.php on line 1788

WordPress Trac noreply at wordpress.org
Mon Mar 23 18:08:56 UTC 2015


#31149: Error Object of class stdClass could not be converted to int in ms-
functions.php on line 1788
------------------------------------+------------------------
 Reporter:  hauvong                 |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  4.2
Component:  Taxonomy                |     Version:  3.0
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  multisite
------------------------------------+------------------------
Changes (by boonebgorges):

 * keywords:  has-patch needs-unit-tests => has-patch dev-feedback


Comment:

 [attachment:31149.diff] has a test that demonstrates the problem and the
 fix suggested by hauvong.

 `global_terms_enabled()` stores the check in a `static`, which makes it
 impossible to toggle for the purposes of the unit tests. This was
 introduced in [14344] in what was, I assume, an attempt to optimize the
 function. @nacin do you have a problem if I roll this back and filter it
 every time the function is called? `global_terms_enabled()` is not called
 anywhere on the front end in core, and nowhere that I've found yet in the
 plugin repo, so I don't foresee any serious performance issues.

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


More information about the wp-trac mailing list