diff options
author | Tim Starling <tstarling@wikimedia.org> | 2023-07-06 16:24:56 +1000 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2023-07-25 09:51:10 +1000 |
commit | a99e31533b5cf85617a51630c98f4d4735686c4e (patch) | |
tree | 9c7b8ec4e82b3015abf88fa5ee2afc9739759b68 /tests/phpunit/includes/diff/DifferenceEngineTest.php | |
parent | dbb99b9dd3cf5d39f74bc5398baa84242a681f7f (diff) | |
download | mediawikicore-a99e31533b5cf85617a51630c98f4d4735686c4e.tar.gz mediawikicore-a99e31533b5cf85617a51630c98f4d4735686c4e.zip |
Ignore parameters to OutputPage::setupOOUI() and deduplicate calls
There are about 33 callers in Code Search, and almost all were calling
it with incorrect parameters.
It was incorrect to call it with no parameters, since this would
globally set the wrong skin and direction. Most callers were doing this.
It was incorrect to call it with the values from some local context.
We are setting a global singleton here so only the global RequestContext
has the correct values.
Usually, setupOOUI() is called to avoid the exception which is thrown
when HTML is generated without a singleton. But it was often called
multiple times in a request, because different parts of the stack need
OOUI HTML and they don't know whether OOUI has been initialised.
So, ignore the parameters passed to setupOOUI(). Ignore all calls after
the first one, so that we can stop throwing away the theme object. Reset
the cached data when RequestContext::setSkin or
RequestContext::setLanguage() are called.
Add RequestContext::getSkinName() so that the name of the skin can be
determined without actually creating the skin object. It would be
complicated to add the method to IContextSource since there is a
method of the same name in Skin, which implements IContextSource.
Change-Id: I7a1e8b613408d2ecc2e497e0672644af85ce0da3
Diffstat (limited to 'tests/phpunit/includes/diff/DifferenceEngineTest.php')
0 files changed, 0 insertions, 0 deletions