Make WordPress Core

Opened 7 years ago

Last modified 2 years ago

#31914 assigned defect (bug)

Remove static variable for global_terms_enable to allow for unit tests

Reported by: jeremyfelt Owned by: jeremyfelt
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Taxonomy Keywords: has-patch dev-feedback
Focuses: multisite Cc:


From @boonebgorges in #31149:

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.

31149.diff makes the necessary changes and adds unit tests to address #31149

Change History (6)

#1 @jeremyfelt
7 years ago

In 32064:

Avoid an unexpected object error when syncing global terms

Pass the expected single value, rather than object, when recursively calling global_terms().

Props hauvong.

See #31914, Fixes #31149.

#2 @obenland
6 years ago

  • Owner set to jeremyfelt
  • Status changed from new to assigned

#3 @obenland
6 years ago

  • Keywords 4.3-early removed
  • Milestone changed from Future Release to 4.3

This ticket was mentioned in Slack in #core by helen. View the logs.

6 years ago

#5 @obenland
6 years ago

  • Keywords changed from has-patch, dev-feedback to has-patch dev-feedback
  • Milestone changed from 4.3 to Future Release

No movement in 4.3, maybe in a future release.

#6 @helen
6 years ago

What do we need here - a consult from somebody with knowledge of the history or an eye on the implications of this?

Note: See TracTickets for help on using tickets.