It is difficult to distinguish this method from OutputPage::addJsConfigVars()
in code search:
https://codesearch.wmcloud.org/search/?q=%5BOo%5Dut%28put%29%3F%28%5C%28%5C%29%29%3F-%3EaddJsConfigVars%5C%28
We generally try to replace $output with $parserOutput or $pOutput
as we touch code, to improve the ability of codesearch to dig up
deprecated ParserOutput methods.
A future project will unify those parts of OutputPage which duplicate
ParserOutput: T301020.
Bug: T300307
Bug: T305161
Depends-On: I39ae7d7a40190eedaa024097a6442cd02b6a02e7
Depends-On: I2c660972b289bbad730ceee1325d70d5ba75d27e
Change-Id: I53c28ee7c80b889c893c1d00f37678e716e55783
This new key name should better signal to developers that this key
will be used as-is without escaping
Bug: T356971
Change-Id: I98849b2e45cc4555eca7674875b9bed89f128310
== Motivation ==
* Reduce amount of configuration switches relating to MW Stats component,
to reduce noise for MW sysadmins and devs.
* Reduce amount of code in the legacy Statsd implementation.
== Background ==
* commit e56f7b6c63 (2015, MW 1.26): Add statsd sampling.
Refers to T106457 under T106450 ("hook usage counts"), which used it
in https://gerrit.wikimedia.org/r/226640 which was reverted shortly
after in https://gerrit.wikimedia.org/r/233045 due to too high
overhead of stats code for something as hot as hooks, regardless
of actual sampling/stats sending.
* commit b203ec5fcd (2016, MW 1.29): Make statsd sampling configurable.
Use case unknown, but it is not used today in wmf-config, and
appears to have never been set in the past either:
```
operations-mediawiki-config (master)
$ git log -p wmf-config/ | grep wgStatsdSamplingRates
24s ec=1$
```
Looking for unmerged patches, I do find an abandoned patch for
the Wikibase extension that attempted to use to instrument database
load in 2020. It was abandoned in favour of dedicated DB tooling
to inspect database queries, which offer more detail as well.
https://gerrit.wikimedia.org/r/q/message:wgStatsdSamplingRateshttps://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/593335
== Future ==
In 10 years, we've not needed sampling anywhere even at our scale.
StatsD absorbs high traffic very well, with controlled flushing to
Graphite as backend. Prometheus exporters are similarly buffered
close to the producer with controlled scraping intervals. This
should make sampling unlikely to be needed.
We did have one experiment where sampling was attempted, which led
to the developments this commit removes. That instrumentation was
removed because the code was far too frequently called and hot that
it posed a latency problem, even before we factor in whether it
sends the metric. The overhead of the stats code itself added too
much overhead to Hook::run / HookContainer.
The new StatsFactory service class does feature per-metric sampling,
although this is similarly without use case at the moment:
https://codesearch.wmcloud.org/search/?q=%3EsetSampleRate&excludeFiles=test
New instrumentations should use StatsFactory, and if sampling were
needed in the future, it could be experimented by calling setSampleRate
on Metric objects (as part of the instrumentation, rather than in
site config, unless the feature in question makes it configurable).
That seems enough upfront investment for a theoretical future need.
Change-Id: I5f68e48d6d2c880a43f83915234d3c9f32a2d1ef
This reverts commit 36d5b83b31.
Reason for revert: This was merged without a breaking change announcement under the assumption that nothing was checking this flag, but unfortunately it turns out this assumption was incorrect. Let’s restore the flag for now, and potentially remove it again later once the removal has been announced and mwclient has been updated.
Bug: T115414
Bug: T294397
Bug: T371977
Change-Id: I70128ab30210213141cbd413e2e51f741c0c5a22
Since 106155e0a4, hooks are now run
run from ContributionsPager instead of DeletedContribsPager, so
update the release notes to descibe these changes.
Bug: T370438
Change-Id: I54e24fddc4577c997775012dc7733f9c0d548e63
Why:
* Special:DeletedContributions is built entirely separately
from Special:Contributions and lacks many of the features
that Special:Contributions has, such as search form filters.
* As part of the temporary accounts project, a special page
showing deleted contributions for temporary accounts was
added via the CheckUser extension (T363362), which has
feature parity with Special:Contributions. This was achieved
by factoring out abstract base classes for contributions
pages.
* SpecialDeletedContributions should be updated to make use of
this shared functionality, to avoid confusion for users
switching between these various pages.
What:
* Update SpecialDeletedContributions to extend
ContributionsSpecialPage.
* Update ContributionsSpecialPage::getUserLinks to be a
protected instance method instead of a public static method.
This can just be done, since it was only made public to be
called from SpecialDeletedContributions, and there are no
other callers.
* Build a link to Special:Contributions instead of
Special:DeletedContributions from SpecialDeletedContributions
by overriding ::getUserLinks.
Bug: T370438
Change-Id: Ica817be5c5e078b88c9b3157b54d0dbf997e8893
These were soft deprecated in 1.38, it's time to emit deprecation warnings
so we can complete their removal from the public API.
Change-Id: I437ab7dc8af4eb5d336e8074a42a0a54b4c00a4b
This hook is no longer used anywhere. It was deprecated in
ded922c21d and all of its users have
migrated to the new MessageCacheFetchOverrides hook.
Bug: T328183
Change-Id: I5f08849b57a33f0853e176a7452b6b3e6d601add
Remove the 'writeapi' field from the response of the query+siteinfo
API module. It had no purpose since MediaWiki 1.32 when
$wgEnableWriteAPI was removed.
Follows up I54ff9428b247ba203d67aba079149393f323d5a9.
Bug: T115414
Bug: T294397
Change-Id: Icedba7f9c7ff58a5ac690cf25e449ba9e2337bd9
Make QueryPage::getQueryInfo abstract as this was the replacement and
every subclass already implements the function
Bug: T244138
Change-Id: I3aca311674e9bf2fa2c5ae7ea10a78b578346fca
Now that PermissionManager can produce a PermissionStatus (1fbe8b761),
we need a way to display it without going through legacy error arrays.
Test plan:
* While logged out, access a page that all logged in users can access,
that uses the PermissionsError class (e.g. Special:Upload)
* While not an administrator, access a page that only administrators
can access, that uses the PermissionsError class (e.g. Special:Block)
Verify that you see the same error messages before and after this
change.
Change-Id: If21200ea1dd66f6443b03625d6a5b8ea416b2922
In change I625a48a6ecd3fad5c2ed76b23343a0fef91e1b83 I am planning to
make Wikimedia\Message\MessageValue use it, and we try to pretend that
it is a library separate from MediaWiki, so it makes sense to move
MessageSpecifier to the same namespace under Wikimedia\.
Bug: T353458
Change-Id: I9ff4ff7beb098b60c92f564591937c7d789c6684
This contains a minor bugfix to the ALLOW_OBJECT hint.
Depends-On: Ied49bd4e03d4ae816dc9ddd6791d92355be6304e
Change-Id: Ibcedd6c0c9809ccae04bfcb7c5892466b48b56ce
Why:
- Enabling by default in DevelopmentSettings.php means that more
developers will interact with the feature and we'll have more input
into ways that the feature works with (or doesn't work with) various
extension and configuration setups in local development environments
What:
- Enable temp user account autocreation by default in
DevelopmentSettings.php
Bug: T359043
Change-Id: Ie88043a7dd7f504092ddd9a6cae1320ab2dbd208
Start with the basic required arguments.
Leaves room for expansion.
Decided to have:
- 0 arguments = interactive
- 1+ argument results in regular validation messages
- --help outputs help as normal
- interactive mode mentions you might want --help
Bug: T48076
Change-Id: I972bf55f96c9cdf1a5eaf55c0e0117b190420d30
For years we had to carefully use mw-content-ltr and mw-content-rtl
subsections to make description, ordered and unordered lists margin
values to work in LTR and RTL mixed content as expected. Now with the
widespread existence of CSS Logical
https://caniuse.com/?search=css-logical
such workarounds aren't needed as now we can just define styles in a
direction aware way.
The only problem is that older browsers which don't support
CSS Logical, that's why this change actually keeps compatibility
margin values for them so they can just ignore those new properties
and the remaining issue will be the support of nested directions for
that older browsers which should be negligible given the benefits
for the newer browsers such as the support of more than two layers
of direction changes (happens in multilingual wikis such as Commons
but rarely) and the fact margin values now will be correct even when
`mw-content-{ltr,rtl}` classes aren't used correctly by the templates
in wikis (which happens more commonly).
The purposed change uses https://caniuse.com/?search=margin-block-start
over https://caniuse.com/?search=margin-block which has even slightly
better browser support.
This change deprecates `i18n-all-lists-margins` module of SkinModule
as now just including of the `elements` module is enough.
Bug: T369475
Change-Id: I404710209d59241991716bb7180bcaabcafffcec
Follow-up to f18362ccce.
While working on I625a48a6ecd3fad5c2ed76b23343a0fef91e1b83,
I learned that Stringable objects are sometimes also used
as normal params, intended to be stringified when rendering.
For example, see `this->target` in the UnblockUser class.
That code uses Message objects, so it's not causing trouble,
but converting them to MessageValue would emit warnings.
I didn't actually intend to deprecate that, and it won't
cause issues with JSON-serializability (assuming we stringify
the objects in time), so tweak how the warnings are emitted.
Change-Id: I26dfd4f1ac8ed08a422692de4e39d072242c08df
As part of refactoring the edit save logic, remove this public entrypoint - the
attemptSave() method is still available. Because the actual logic is still
needed by core, we move it to a new private method,
internalAttemptSavePrivate(), and call that from the deprecated
internalAttemptSave() method.
Bug: T157658
Change-Id: I79ccb85f645e15256c4b5867ef3997d10a611e53
Instead of creating a half-initialized helper and later calling ::init,
provide all the information necessary for the helper in the constructor.
This is facilitated by the fact that there already exists a factory
class, PageRestHelperFactory, which holds all the services required.
This affects:
* HtmlOutputRendererHelper::init()
* HtmlMessageOutputHelper::init()
* HtmlInputTransformHelper::init()
Change-Id: I1e1213597c6be012f2bc024c2b370c968ff3b472
This class was @unstable and should be replaced by ParserOutputAccess.
Bug: T367074
Depends-On: I543a6e9da4fc473a2ac54ac635286453f2aff96a
Change-Id: Ie51b9b7a8b42a6faafeb28378c188347f274a9c5
BagOStuff::watchErrors() returns a token that can be used with the
BagOStuff::getLastError() method to get the last error registry. Use
this instead of deprecated clearLastError().
This new style for clearing last errors was introduced in 2021,
I281817a85602967c0ec2bdd23a5d8be101680b64 (I281817a85602967) as it
is more robust due to its support for allowing nested callers.
An outside BoS instance might want to watch the errors returned by
multiple internal BoS instances and with the use of watch point
tokens, this is possible.
This patch hard deprecates BagOStuff::clearLastError() and
WANObjectCache::clearLastError().
Change-Id: I9b7a77bae8c0d5cc0235f0894a92f8e38628826d
Why:
- Temporary accounts will become the default anonymous editing
paradigm on Wikimedia wikis (and maybe for MediaWiki via T355880),
so we want this to be the default that we test against in CI
What:
- Enable AutoCreateTempUser in DevelopmentSettings.php when
MW_QUIBBLE_CI is set. That means it will be enabled for CI, but not
by default, in local development setups that include
DevelopmentSettings.php
Notes:
- PHPUnit tests that need to run in an anonymous IP editing context
should use TempUserTestTrait::disableAutoCreateTempUser()
- Selenium and API-testing tests that specifically check anonymous
IP editing context should use a custom LocalSettings.php override
to disable temp accounts feature for the duration of the test
Bug: T359043
Depends-On: I375cf7dfec1667396136402a85cbbb68efd43069
Depends-On: If48a33794132b46fb51d864bce103aa8285443c3
Depends-On: I604c521f00d5cc64b8102c93f9a013bcac557001
Depends-On: Id6ec4b9e438dd277a51f781377a93756fa4c3996
Depends-On: Ib0a176fe335cf45e5b2cdd351c95d5da162a1eb2
Change-Id: I8c4395ac1bdbc0c55aa45038cbbd589025b4aeef
This patch emits deprecation warnings when extensions override
Handler::getBodyValidator() or otherwise use JsonBodyValidator.
Request body validation should be performed based on body parameter
declarations returned from getBodyParamSettings().
Bug: T358560
Depends-On: I8b12c9c9d5a73c620e3c5d035f815d7c951c7b30
Change-Id: I44b3395b8d2489c5e7ec8de0077fd7a7c9f49bfe
The last callers themselves were already soft deprecated and the
singleton on UserCache itself was almost unused. The last usage has
been replaced and the method now emits deprecation warnings.
Change-Id: Ic9f5e4f427c0402b6c0e7232bcf1d5f9eec6e73e
This method has become unnecessary after we introduced interfaces that
return StatusValue objects directly instead of legacy error arrays.
Depends-On: I2311d1fa3772ba6be378ad6f497ed4c0df9b7aa8
Depends-On: I3af555c31320d8e9b1362dfc8bf0d8315539ba4f
Depends-On: I1d9e1c94b814b22a7691b710ed033526cc823032
Change-Id: Ifa67cf4e05a318539f6254a631de14156c41d462
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
This hook enables extensions such as CentralAuth to preserve and
use query parameters needed for an authentication flow. Since there
is a provider that handles logins in a different wiki (central login
wiki), and movement to a different URL, this hook preserves query
parameters that can be used between these requests.
Bug: T363483
Bug: T362713
Change-Id: I86e629b07e6e4a0f1d1a4c78a6c77d41b4d68e18
These methods: getSegmentationSize() and getSegmentedValueMaxSize()
in both the BagOStuff.php and MediumSpecificBagOStuff classes seem
unused for a while now. Codesearch shows that we have no callers of
both the parent and child class overrides.
Since these are public interfaces, they'll have to go through the
deprecation process.
Introduced in b09b3980f9 (I0667a02612526d8ddfd91d5) and later
in 2021, usage was all removed in 942f708b61 (I5c4bd74379bc45).
Change-Id: Ie529841e673abc7b68f870539dbb23a34a292c89
This was already hard deprecated and unused, since 1.42. Time for
it to go. Farewell `setNewPreparedValues()`.
Change-Id: I95c8e4ba91187348603515df2b453d4a11623b99
This is the Language Converter from Meitei Script to Bengali Script in mniwiki.
I don't know the language. I got help from a native speaker User:Haoreima.
The original prototype was in a Python Library written by myself.
It only converts the words that have Meitei characters (U+ABC0..U+ABFF).
The original prototype is already being used in mniwiki via Gadget and a Bot.
Bug: T357853
Change-Id: I810f18050f29efa38b2a646d96644e298af47c50
Hard deprecated since MW 1.41.
Unique method name that does not appear in CodeSearch for MediaWiki
& services at WMF. Couple of CodeSearch hits using the "Everything"
filter.
Bug: T362636
Change-Id: I2ea134d31a8b18375183a4ae413e77dc0a6f1acc
Git blame on wfDeprecated() is 7 years old.
Unique name, no sign of it in CodeSearch for MediaWiki & services
at WMF. Couple of CodeSearch hits using the "Everything" filter.
Bug: T362636
Change-Id: I8961ebb3a72b328e839659aeeee3e73512a88dee
Post I5039c7ef9e07199c256fd568b4f94714e5831d17, gallery image captions
are no longer placed on new lines, so the presence of leading whitespace
shouldn't be significant.
This fixes an inconsistency in gallery image caption trimming, where
only the first and last option had start and end trimming, respectively.
It also matches Parsoid output, where no trimming takes places, as seen
in the updated tests.
Change-Id: I2a80198c43598dc8c7fa61cb4b0340a97d2ee895
Git blame on wfDeprecated() is 4 years old.
Unique names, no sign of them in CodeSearch.
Bug: T362636
Change-Id: I90f11dc78be0938aea53a304b5824f034dd70107
`@width-breakpoint-*` Less variables have been removed. Use
`@min-width-breakpoint-*`/`@max-width-breakpoint-*` instead.
Follow-up to Ie06bf3e15e552.
Bug: T349793
Change-Id: Ie397cf6839fa03ef84d3906f6d9f56c9b090884a
getPermissionErrors() uses a weird format for its return value that
is slightly different from the usual "legacy error array", and legacy
errors arrays are already icky. Deprecate it without changing this
format, and introduce getPermissionStatus() to replace it. Document
the return format more precisely.
Refactor PermissionManager to use PermissionStatus objects internally,
and only convert to the weird format in the deprecated method.
However, fix a scenario where the error array could directly contain
MessageSpecifier objects or strings instead of nested arrays,
as the documentation said that was not possible. Fix a test case
demonstrating this incorrect behavior.
Change-Id: I6670a58fe1fcb4e1ae87351277e5ddf29c548183
updateSpecialPages.php runs QueryCache::recache() for each special page being
updated, with the $ignoreErrors parameter set to true (the default). While this
successfully swallows the original error, the script will immediately fail
anyways with DBTransactionStateError ("Cannot execute query from
Wikimedia\Rdbms\Database::ping while transaction status is ERROR") .
Since the guidelines[1] consider catching DBError without proper cleanup a
transaction misuse error, and explicitly discourage it, let's allow the original
erorr to bubble up instead. This has the additional benefit of providing helpful
context for whoever will inevitably have to debug why the script failed.
---
[1] https://www.mediawiki.org/wiki/Database_transactions
Bug: T278543
Change-Id: Ic81e7c5e13b2461c8eafc3ae5a57cdec5462cc4f
This is to make it clearer that they're related to converting serialized
content back into JSON, rather than stating that things are not
representable in JSON.
Change-Id: Ic440ac2d05b5ac238a1c0e4821d3f2d858bc3d76
I can't find anything in codesearch that uses this parameter. The
behaviour is odd and won't work for anything except a test. The other
parameters to User::createNew(), such as "email", will be written to the
database as initial values for the new user, which seems sensible. But
this "options" parameter just sets up fake options "prefetched" from
the DB, but doesn't actually insert them.
Bug: T323076
Change-Id: Icef65cb9f354197bc6dbcc92a3cf4d4e2918f2e8
Fix the dependency loop between PreferencesFactory and
UserOptionsManager by moving the concept of "reset kinds" or "option
kinds" to PreferencesFactory.
Note that this is a half-baked feature from 2013 (I5f9ba5b0dfe7c2ea)
that is not really used for anything. Apparently only the "all" and
"unused" kinds are used.
The strong dependencies on PreferencesFactory internal details show that
this feature belongs in PreferencesFactory. But UserOptionsManager can
reset "all" preferences without help from PreferencesFactory, so add a
helper for that.
The rationale for putting it in UserOptionsManager was that eventually
all preference definition information should move to UserOptionsManager
(T250822). I don't agree with that. UserOptionsManager is the key/value
store which backs PreferencesFactory. I need to refactor it further for
T323076 and it will help to have these concepts be separate.
Hard-deprecate UserOptionsManager methods resetOptions, listOptionKinds
and getOptionKinds. Add convenience methods to replace calls to
resetOptions().
I couldn't understand the logic in resetOptions(). Why was it copying
old values instead of just omitting them? Why was it assigning null but
only for "all"? setOption() had a documented method for resetting an
option to the default, so I just used that.
Bug: T323076
Depends-On: I1ed0a1a9f6492fb50254104fa4bc9f2130218323
Change-Id: I900fd4a48c96d91491eae54824e7bf02a004843d
Move Linker::makeExternalLink to the LinkRenderer service, as has been
done with the other static methods of Linker.
In order to allow phan's SecurityCheckPlugin to perform a more accurate
analysis of taintedness, tweak the API of Linker::makeExternalLink to
clearly indicate via the type system whether the link text has already
been escaped or not: a `string` argument will always be escaped, and
if the argument is already escaped it should be passed as an HtmlArmor
object. In refactoring, `Message` arguments were also common, and accept
them as-is to avoid the caller having to think about whether to call
Message::text() or Message::escaped().
This allows us to provide a more precise taint type to the $text argument,
avoids an opaque boolean argument, and avoids spurious errors from
SecurityCheck.
We also require the caller to explicitly pass a Title context, instead
of implicitly relying on the global $wgTitle. This works cleanly
everywhere except for CommentParser, which has a $selfLinkTarget which
generally works as the title context for the external link, but which
is nullable. The original Linker::makeExternalLink() used $wgTitle as
a fallback, but $wgTitle can also be null in some circumstances. The
title context only determines how $wgNoFollowNsExceptions is handled,
so existing code basically just ignored $wgNoFollowNsExceptions when
$wgTitle was null, which isn't terrible. A future refactor could/should
clean up CommentParser to ensure that there is always a non-null title
context that can be used.
Change-Id: I9bcf4780f388ba639a9cc882dd9dd42eda5736ae
Use just the CSS rule `break-after: avoid-column;` instead now.
Also replacing one occurrence in Wikimedia deployed software of the
mixin and align other mixin call to coding guidelines.
Change-Id: Ie77f39136ae7320dc37f74930297e0721fcf0c19
Note that CSS module filenames in this release have an extra 'Cdx'
prefix - this is a known bug that will be resolved with the next
release. For now, these files are not used directly, and are
properly tracked by the manifest, so there should be no discernible
changes. See T366206.
Bug: T363432
Bug: T363858
Bug: T364611
Bug: T364636
Bug: T364762
Bug: T364789
Bug: T364894
Bug: T364927
Bug: T364929
Bug: T364934
Bug: T365003
Bug: T365363
Bug: T366097
Depends-On: I04c1250aef3afbff43c11a012194263ec6b0f533
Change-Id: I4988a93e8cb0f33c198303403dde8d92223d63c4
This functionality was introduced in 2021 (commit 349819dc5a)
to support the addition of UserGroupMembershipParam, which was
never used, and no other use case appeared.
Its existence is now preventing us from allowing serializing
of MessageValue objects as JSON (since the parameters can't be
guaranteed to be serializable).
Deprecate:
* method: MessageValue::objectParams()
* method: Message::objectParams()
* method: Message::objectParam()
* class: UserGroupMembershipParam
* constant: ParamType::OBJECT
* Passing Stringable objects to ScalarParam
Change-Id: I492edabb7ea1d75774b45eb9fd18261b39963f9f
- Add a disabled by default feature flag 'EnableProtectionIndicators'
- When the config flag is enabled, show a lock indicator at the top
of the page.
- The lock icon should be overridable by the content of the page
- The indicator has a predictable ID which could be potentially used
to style the icon using the onwiki Common.css file.
- The lock icon by default links to https://www.mediawiki.org/wiki/Help:Protection. However
this link can be customized per wiki per protection level using a
empty message (for example: `protection-sysop-helppage`)
Bug: T12347
Change-Id: I3e36d98edfe54a9c138b1fe8e5057e107ded281b
This adds MediaWiki\Watchlist namespace to the classes of watchlist
directory and adds deprecation notice since 1.43 to the just created
unnamespaced aliases of the classes.
Bug: T353458
Change-Id: I4234f8fe62bb3bde6f5271c7ba31a2420b0f4b90
This adds MediaWiki\Content namespace to FallbackContent
and FallbackContentHandler and declares the unnamespaced version
as deprecated since version 1.43.
Bug: T353458
Change-Id: I3ee80aea379788b71539cc1c7a4ec216b753e042
This patch completes the rest of the ObjectCache refactor and
migrates methods to the appropriate class while deprecating them
in `ObjectCache.php`.
It also moves the `_LocalClusterCache` internal service logic
into ObjectCacheFactory and calls that instead making sure that
wiring code stays wiring code and let the class do the heavy lifting.
`::makeLocalServerCache()` is retained as a static method in the
ObjectCacheFactory class because it's called early in Setup.php
before the services container is available (so it needs to be stand-
alone).
To add, we also converts all global variables that were used in the
`ObjectCache.php` class into the config schema approach and retrieves
them using ServiceOptions injected in service wiring.
NOTE: MediaWikiIntegrationTestCase::setMainCache() was slightly
rewritten to take care of service reset which throws away the cache
object preserved by setInstanceForTesting() after service reset.
Instead, we preserve the object via MainConfigNames::ObjectCaches
setting with a factory closure which returns the correct cache object.
As a nice side effect of the above, the setInstanceForTesting() method
was removed entirely.
As a follow-up to this patch, I would like to remove the internal
_LocalClusterCache service in a stand-alone patch.
Bug: T363770
Change-Id: Ia2b689243980dbac37ee3bcfcbdf0683f9e1779b
A little history: This is the first time that the $linkTrail
regular expression uses \p with a script name and not explicit
characters or code point numbers.
Bug: T365365
Change-Id: Ia3cf06b8241f74772608179605f1fd7f08a08f8c
Trigger a deprecation warning if MessageCache::get gets called without
a Language object. On omitted parameter still the content language is
used.
Also change from $langcode = true to $language = null. This allows to
introduce a PHP type check in I8d0de2c7c2e6d087228844874d8251933b4acea4.
Change-Id: Ib27cfc0af090790daca3995fb1c3d78712d53ae6
I removed a lot of tests that were asserting value of this since this is
internal to database and it doesn't serve a critical purpose (it only
changes some log prefix)
Bug: T363839
Change-Id: I2930e4b489a41b7a1e1965a8ebf21b183bca773e
The current implementation of ExtensionRegistration violates the
documented behavior for extension registration, as described in
[[mw:Manual:Extension.json/Schema]]. According to the documentation,
when at least one of the global value and the default value is not an
array, the merge strategy is ignored and the global value will simply
override the default. However, an optimization incorrectly replaces a
configured empty array with the default null value.
The issue was fixed by applying the optimization after checking the
violated condition. Tests have been expanded for similar cases and
now additionally provide array diffs on failure.
WMF production configurations were evaluated with and without the
patch, and differences were analyzed on a per-wiki basis. This patch
results in two changes:
1. $wgCirrusSearchWriteClusters changes from null to []. This is the
desired behaviour.
2. $wgLiqudThreadsAllowUserControlNamespaces changes from null to [].
null means "no limits" and an empty array means "nothing allowed".
This matches the intended configuration and will be corrected
by this patch.
Bug: T365190
Change-Id: Ia3eaf6a607840e3e3134bded37e45050b7f247bf
The removed tests in LinkerTest were ported (or were previously
ported) to the new CommentFormatter framework in the CommentParserTest
class; some references to the LinkerTest class have been removed since
CommentParserTest is now the canonical location for these.
Cleaned up a bit more from the removed DummyLinker class as well
(I69689b2037269af3320b6203fc44755f93713489).
Followup-To: I69689b2037269af3320b6203fc44755f93713489
Change-Id: Ia743d13c4fe7f4e3e2bd11274895a261adbfd8e2
This was introduced to allow maintainers during local development,
and e.g. when debugging in production, to capture silenced runtime
warnings, such as those silenced via AtEase or the `@` PHP operator.
These are not expected to be of interest to capture by default on
web requests, hence placed in a separate channel that e.g. one would
only enable during development, or when debugging.
When this was introduced, MediaWiki was only just starting to
experiment with PSR-3 structuerd logging, and thus it hardcoded JSON.
Now that we support structured logging natively, this has been
obsoleted by the "error" channel (for warnings in production),
and (since last December) the "silenced-error" channel (for debugging
and development) with commit f6cb39979b (I34b19837c3).
With the above two alternatives available, there is no longer a need
for the duplicate "error-json" channel.
Bug: T193472
Change-Id: I7a6e6fa52a47a29ec04411a6c8b05e005a0a4fc7
Looking at all implementations, it only returns null or getServerId(),
which we already rely on in the only caller SqlBagOStuff.
Bug: T363839
Change-Id: I680e82d6d36548cd6bc351ab1d1fba48a827cbf3
DummyLinker existed for backwards-compatibility with a few hooks that
have since been removed, e.g. 'LinkBegin'. The last hook using it is
'ImageBeforeProduceHTML', and it looks like it can be harmlessly
replaced there with `null` (none of the extensions implementing the
hook use this parameter).
Change-Id: I69689b2037269af3320b6203fc44755f93713489
Document changes to hooks that were run from SpecialContributions
and ContribsPager, which are now run from ContributionsSpecialPage
and ContributionsPager instead.
Bug: T363358
Change-Id: I5e8fc87e7e98798d98b22405ca5cca5303945a91
This is useful to link to the talk page of a page that is only known by
its title without needing to parse it or make any API requests.
I originally had the class extend RedirectSpecialPage, but couldn’t make
the form work properly that way, so eventually I opted to extend
FormSpecialPage instead and implement the redirect behavior directly.
Cache behavior is moderately aggressive, pinned to the parser cache
expiry, as these redirects should only need to change when the
namespace settings are updated.
Bug: T242346
Change-Id: I531b0b061d1ff1fef9ceffd6c82dc34940ba653d
* Deprecate and stop using $wgBlockTargetMigrationStage. Remove
block_target migration code.
* Make the $schema parameters to DatabaseBlockStore methods default to
SCHEMA_BLOCK. Avoid passing these parameters where possible.
* Remove cleanupBlocks.php
* Deprecate DatabaseBlock static methods which try to present the old
schema for b/c.
Bug: T362133
Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
Modules group together endpoints by a shared prefix. The idea is that each module has its own version and can generated self-contained self-documentation. This allows clients to have clear expectations about the endpoints of each module, no matter what wiki they are accessing. So far, each wiki may be exposing a different set of endpoints, with no way to provide a spec that describes that set of endpoints in a way that would be consistent across wikis and stable over time.
Bug: T362480
Change-Id: Iebcde4645d472d27eee5a30adb6eee12cc7d046b
Redirects from one route to another can now be defined in route
definition files like this:
{
"path": "/path/to/trigger/a/redirect/{foo}",
"redirect": {
"path": "/redirect/target/{foo}",
"code": 302
}
}
It is not necessary to specify the handler class.
The default status code is 308.
Path parameters and query parameters will be looped through.
Bug: T361840
Change-Id: Ib095681498874d90bdb7f970924906dc9a0f8c50
Legacy parser can now output headings using a more accessible markup,
which is also identical to the markup used by the Parsoid parser.
Changes to client-side JS and CSS necessary to support the new markup
have already been merged in earlier commits.
includes/skins/Skin.php
includes/ServiceWiring.php
* Define a new skin option, 'supportsMwHeading', which can be used
to toggle the new markup per-skin.
* Update the built-in fallback skin to enable it. This affects the
output in parser tests.
docs/config-schema.yaml
includes/config-schema.php
includes/config-vars.php
includes/MainConfigNames.php
includes/MainConfigSchema.php
* Add a new configuration setting, 'ParserEnableLegacyHeadingDOM',
which can be used to toggle the new markup per-site.
includes/OutputTransform/Stages/HandleSectionLinks.php
* Output new heading HTML for skins that enabled the option.
tests/*
* Duplicate parser tests that cover heading generation to cover both
new and old markup. Update other parser tests to use new markup.
* Add some unit and integration tests for the behavior of the skin
option and some parser tests for edge cases of the new markup.
Bug: T13555
Change-Id: I1180169a8e83af834c2984ba16089e6277f2a8dd
Autonym according to Ethnologue is "Baso Palembang".
This is also the name most commonly used by the
language's speakers according to the article
Alsamadani, Mardheya; Taibah, Samar (2019).
"Types and Functions of Reduplication in Palembang".
Journal of the Southeast Asian Linguistics Society.
Bug: T364291
Change-Id: I4a867a8671ab32366aa459d49361682305b67dcb
In 1.35 we deprecated not passing the timeout and connectionTimeout settings
when constructing the MWHttpRequest object.
Upgrade hard-deprecation via wfDeprecated() to instead throw an InvalidArgumentException.
Change-Id: I260469c6235fa9022b264757b0a17d498cee1396
Unused in core since 76fa952, and uncalled in codesearch covered extensions;
was only left for those use cases. The special page now uses onSubmitForm
instead of this function.
Change-Id: I87c3bbc9a9aff381b00822971fdb41780b32bd3b
openssl provides the proper password hashing algorithm, so it is needed
in order to have safe and efficent password hashing.
Change-Id: I61498275c7f7cf19787f0aee50dc4884c57b82b2
which takes two timestamps in order to calculate a more accurate text representation of the duration between the timestamps
Bug: T219397
Co-authored-by: addshore <addshorewiki@gmail.com>
Co-authored-by: Silvan <silvan.heintze@wikimedia.de>
Change-Id: I290f8da815f9571dae75fddde2da2010cc9a7fec
Doing this should make it easier for us to fix bugs and maintain
this, there seems little benefit in having this published on
npm.
Bug: T358813
Change-Id: I515e415a129da881eecdb86d8e6a274bf7584b4a
Some of these have been marked in-code as deprecated for a long while,
but haven't ever been announced in the RELEASE-NOTES (and later,
HISTORY) file, so let's mark them up now so we can get the ball rolling
at least.
Per Gergo, the AuthManager one was 'born deprecated' and should only
have been used by humans also reading the deprecation notice given in
the code, and indeed no uses are known to code search, so also emit
deprecation warnings there immediately; others will have to wait until
uses have been migrated.
Change-Id: I0c1c71d8f4293623039302da35d58d2a24367e97
StatusValue::replaceMessage() doesn't really work if given a
MessageSpecifier, and doesn't work at all if given a MessageValue.
StatusValue::hasMessage() and ::hasMessagesExcept() ignore the message
parameters when searching if given a MessageSpecifier or MessageValue.
Therefore, deprecate passing anything other than strings representing
message keys to these methods.
Change-Id: Icb4effc6c5319c12ba4ebeab447a0cef54f8e255
The parameters have always been ignored, so this is usually a mistake.
Depends-On: Ic12241bd3029bc1b0e7a0023689a2be35ccd30a8
Change-Id: I0675e557bb93a1c990fa923c50b9f6ee8a9836c8
By doing this, auto-creation get available for users who use blocked IP and hold ipblock-exempt or globalblock-exempt, as autocreateaccount permission is checked on the user theirself rather than on anonymous IP user.
Bug: T316303
Change-Id: I2ad825317e900e865fffa39d4ea644f07beb4cf8
Signed-off-by: Bingwu Zhang <xtexchooser@duck.com>