UnknownContentHandler can be configued to handle models that
belong to extensions that have been undeployed:
$wgContentHandlers['xyzzy'] = 'UnknownContentHandler';
This way, no errors will be thrown when trying to access
pages with the unsupported model. Instead, an error message is
shown, and editing is prevented.
This patch also improves handling of non-editable content in
EditPage and in DifferenceEngine.
Bug: T220608
Change-Id: Ia94521b786c0a5225a674e4dc3cb6761a723d75b
Transitional step for the transformation of SearchResult into an
abstract base class:
- RevisionSearchResult is introduced to behave like SearchResult
- methods are currently shared between RevisionSearchResult and
SearchResult in the RevisionSearchResultTrait
Bug: T228626
Change-Id: I13d132de50f6c66086b7f9055d036f2e76667b27
100% test coverage of code that appears to be working and used, in both
LockManagerGroupFactory and also LockManagerGroup. Where possible I
wrote it as unit tests. One preexisting code path seems to be broken and
I marked the test as skipped. Two methods look unused and perhaps not
especially helpful, so I didn't write tests for them yet in case we want
to just get rid of them instead.
Change-Id: Iaa7354f31c451b87773468609c674a3bf1d4382f
Add a very basic test that creates an instance, invokes it
with an empty string, and asserts the types and values returned
by the public methods used in LanguageConverter::applyManualConv.
Bug: T225756
Change-Id: I3600260e712f019243ba5f00890011e694444e43
These are static methods that have to do with processing language names
and codes. I didn't include fallback behavior, because that would mean a
circular dependency with LocalisationCache.
In the new class, I renamed AS_AUTONYMS to AUTONYMS, and added a class
constant DEFINED for 'mw' to match the existing SUPPORTED and ALL. I
also renamed fetchLanguageName(s) to getLanguageName(s).
There is 100% test coverage for the code in the new class.
Change-Id: I245ae94bfc1f62b6af75ea57525139adf2539fe6
I think this probably shouldn't be directly in the MediaWiki namespace,
but I don't know where is a better place to put it.
In order to avoid gratuitous use of TitleFormatter, I changed the cache
format -- the old implementation used getPrefixedDBkey() and I switched
to an ns/dbkey pair. I also changed the cache keys to use SHA1 instead
of MD5, by Daniel's request.
The previous implementation cached the parsed blacklist for one minute
without invalidation, so it could return slightly stale results, but it
didn't retrieve the bad image list message on a cache hit. The new
implementation unconditionally retrieves the bad image list message, but
uses a hash of it in the cache key and caches for one day. The new
behavior happens to be more cleanly implementable in a service.
Bug: T200882
Bug: T139216
Change-Id: I69fed1b1f3cfc1aa149e0739780e67f6de01609d
This will help make MovePage more testable.
In the course of abstracting the logic out of ParserFactoryTest to
FactoryArgTestTrait so it could be used in MovePageFactoryTest, I made
them all unit tests instead of integration. This required some
modification to the Parser constructor so that it didn't access
MediaWikiServices unnecessarily.
Change-Id: Idaa1633f32dfedfa37516bb9180cfcfbe7ca31aa
After approval of RFC T191231, we are going to drop oracle and mssql
and it will be possible to bring back the support using the abstract schema
Adding to release notes will be done in a follow-up
Bug: T230418
Change-Id: I90bd5cfcc3e18011b193c965fdb1fa54675040b5
The purge() method handles purging of both file cache and CDN, using
a PRESEND deferred update. This avoids code duplication and missing
file cache purge calls.
Also:
* Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob
* Add HtmlFileCacheUpdate class and defer such updates just like with CDN
* Simplify HTMLCacheUpdate constructor parameters
* Remove BacklinkCache::clear() calls which do nothing since the backlink
query does not actually happen until the job runs
Change-Id: Ic453b189a40109a73a9426538608eea87a76befa
Previously, if there was an error during CLI installation,
CliInstaller::showStatusMessage() exited the script directly. The exit
timing of the script should be given to the caller, not the callee.
So, I coding:
[1] Remove `exit()` from CliInstaller::showStatusMessage()
[2] Make the callee to return Status, the caller determine how to handle these Status
[3] Strictly check the key database type instead of just outputting message
Bug: T46511
Change-Id: I72ffd33fe5c592b9ea78f37bae5a9c081295c624
trait meant to hold methods that rarely overridden or that are
non trivial to implement.
Bug: T228626
Change-Id: I4fba27b22860109d648e830a435d4a036d26ad06
This uses MovePage where possible to try to better keep data in sync.
Archives, log entries, and so on can't do that though.
The script skips User and User_talk pages for registered users, as
renaming the users is more complicated than makes sense to try to
implement here. Use something like Extension:Renameuser to clean those
up; this script can provide a list of user names affected.
Bug: T219279
Change-Id: I157577cb5bedfd347b808c254fb19ae8088818ab
If a key is stored in both BagOStuff and WANObjectCache, it useful to have
one common method for generating the cache and storage keys.
Change-Id: I8b77651746a55e8a98a79db298226e334d15a494
* Inject settings and global instances as dependencies to the
ExternalStoreMedium instances. This includes the local wiki
domain, so that wfWikiId() calls are not scattered around.
* Create ExternalStoreAccess service for read/write logic.
* Deprecate the ExternalStore wrapper methods.
* Add some exception cases for bogus store URLs are used instead
of just giving PHP warnings and failing later.
* Make moveToExternal.php require the type/protocol to decide
which ExternalStoreMedium to use instead of assuming "DB".
* Convert logging calls to use LoggerInterface.
Change-Id: I40c3b5534fc8a31116c4c5eb64ee6e4903a6197a
And start indicating that hooks relying on this data might become
unreliable as this data is only populated by SearchDatabase search
engines.
This information was only populated by SearchDatabase implementations
and due to bad initial design of SearchResult[Set] (now fixed) it forced
users of these classes to carry this information for the sole purpose of
highlighting.
Because SearchEngine can now own their SearchResult[Set] implementations
nothing that is engine specific should be exposed outside of these
specific implementations.
If there are some logic that still requires access to such list of terms
they should be made engine specific by guarding their code against
instanceof SqlSearchResult.
Change-Id: I38b82c5e4c35309ee447edc3ded60ca6a18b247a
Depends-On: I53fe37c65c7940f696c1e184125e01e592a976e4
- Special:Mute has been added as a quick way for users to block unwanted
emails from other users originating from Special:EmailUser
- Special:Mute can be enabled by setting $wgEnableSpecialMute = true.
This flag default value is `false`. This flag is temporary until
enough wikis have this feature enabled and then it will go away
- When Special:Mute is enabled, emails sent from Special:EmailUser
contain a link to Special:Mute to facilitate access to the page
In the future, Special:Mute will support extensions to append other types
of notifications that could be muted. These are some of the tasks tracking
the rest of the work:
- T218270
- T220163
- T218266
It is worth mentioning that blocking emails from users is already available
via Special:Preferences
Bug: T218265
Change-Id: I54b847192f42ee1f37999d36c3a187f8826f55a8
Either the server needs to omit these from the registry with
state=error output to the client (and server-side error logging),
or it needs to detect them, and transport them unchanged, so that
the existing client-side logic can handle it.
This patch does the latter.
Without the source code change in this patch, the added test case
fails due to "top" and "middle1" then being registered with
an empty array as dependencies.
Bug: T223402
Change-Id: I57502d7c4e434de4737759aed325dd4200ca89bf
You can now create ResourceLoader modules for arbitrary sets of OOUI
icons. This is an alternative to I8af783666a2b23a938af93c1b56fee619219eaf5.
Update dependencies of OOUI's modules to use custom icon packs instead
of default icon packs.
Bug: T160690
Change-Id: Icf9560da79c91e56c7a3f4c0de01dd057f5aa00d
Use it for ApiStashEdit so that large PaserOutput can be stored.
Add flag to allow for value segmentation on set() in BagOStuff.
Also add a flag for immediate deletion of segments on delete().
BagOStuff now has base serialize()/unserialize() methods.
Bug: T204742
Change-Id: I0667a02612526d8ddfd91d5de48b6faa78bd1ab5
Refactored buildPrevNextNavigation() into standalone helper class,
PrevNextNavigationRenderer, to be used by both SpecialPages and Pagers.
Bug:T207977
Change-Id: Ic49837a451f795ec203e867961ec1c69075cc91a
This API module can be used to get information about all the languages
supported by this MediaWiki installation. Since parts of this
information, such as the fallback chain, are expensive to retrieve if
the localization cache is not populated, we apply continuation if the
request is taking too long (suggested by Anomie in T217239#4994301); we
don’t expect this to happen in Wikimedia production, though.
Bug: T74153
Bug: T220415
Change-Id: Ic66991cd85ed4439a47bfb1412dbe24c23bd9819