| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Calling getPageById when the page ID is known was supposed to improve
query performance, but since it bypasses LinkCache, it ended up causing a
spike in database queries.
This optimization can be re-introduced once we also cache PageRecords by ID.
Bug: T296063
Change-Id: Ia4ee75b7b5a71d7d858f818d6467793bc642697b
|
|/
|
|
|
|
|
|
|
| |
For now, let's just proxy the title object and set the
interwiki but to make things nicer, we should not provide
a title via setUp(), we should use providers.
Bug: T275763
Change-Id: I761de85ae5a839e8a695b85ce0fd7200b498da22
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This causes Title to no longer look up fields in the database
individually, but use LinkCache instead to load an entire row from the
page table at once.
This patch also causes Title to use in-process caching for some
getters that did not use caching before, such as isNewPage()
and getTouched(). These methods do not appear to be used on critical
code paths that involve database updates.
Note that getTouched() used to take an options $db parametr. This
appears to be unused, and has been deprecated in favor of a $flags
parameter, for consistency with other getters on the class.
DEPLOY: Risky! This re-implements the internal caching logic of Title
and slightly modifies caching semantics in some cases. This may have
unforeseen consequences.
Bug: T285389
Depends-On: I103b9e1d2bf594bfc1b0ea12b980dd20bb911c3a
Change-Id: I2df81df7186025e001520f24fd498623c7184772
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These type-hints are definitely correct, but it's still
a relatively risky patch cause of how messy Title is.
I did some manual review of Title, all tests are passing,
but even still if this is approved, I'll add it to phab
as a risky deployment.
Change-Id: I1ed98ddae30066956e7adbde6780d6bab54dec04
|
| |
| |
| |
| |
| | |
Bug: T292464
Change-Id: Ie9cb3036a69810344971c49c424a76c7fa1cba07
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
New option 'absoluteURLs' was added to getText method
of the ParserOutput object that replaces all links
in the page HTML with absolute URLs.
Removing the action=render special case from Title
seems safe cause we will end up replacing the result
with absolute URL if we're in a render action no matter
where Title::getLocalUrl was called from.
This change is safely revertable from the perspective
of ParserCache.
Bug: T263581
Change-Id: Id660e1026192f40181587199d3418568f0fdb6d3
|
|/
|
|
|
|
|
|
|
|
|
| |
Also remove the "@unstable" annotation from DeletePage.
Methods without known usages were hard-deprecated, the others
soft-deprecated.
Bug: T288758
Bug: T288759
Change-Id: I30c62572fd533526779a8ade3ab178f35bebb522
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I48161585de6f329ec4037156234e0b07b3b837e6
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
Simplify setting of the class property
Bug: T290642
Change-Id: I0ed383532876bfbe33e07263202d908cffb39786
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This makes the data stored by LinkCache compatible with PageStoreRecord,
so we can use LinkCache inside PageStore.
This causes PageStore to make use of local caching as well as WANObjectCache.
Note that getPageById() does not yet benefit from cache, but does
populate the cache.
Bug: T278940
Change-Id: Icc27a0d9299a3e4ce45521daef87ad06ec06f064
|
|\ \ \
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The behavior of getCascadeStrictionSources was changed by Ia73ea587586cb69eb5
to conform to the documented behavior: it would always return false as the
first element of the return value if there were no cascading restriction sources,
as specified in the documentation.
Hopwever, the previous behavior was to return an empty array in that
case, unless the $getPages parameter was false. That behavior seems more
senible, and there is existing code that relies on it.
This patch restores the previous behavior and updates the documentation
instead.
Bug: T218395
Needed-By: I31ca0a8987f9694bc3b312a48c2c111ceda6fa3e
Change-Id: I1f24703b80566220ac6fe8ee500e838ed7fd29af
|
|/ /
| |
| |
| |
| |
| |
| | |
There are no callers of this method anywhere in our codebases. Seems
like a relic from past refactoring. But maybe I'm wrong.
Change-Id: Id8296ca28518a54d1712bca6b9770b918c92e0c2
|
|/
|
|
|
|
|
| |
Addition and remove of suppression needs to be done with the version
update.
Change-Id: I3288b3cefa744b507eadebb67b8ab08c86517c1c
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This allows checking restrictions without a dependency on Title, based
only on a PageIdentity.
Additional fixes along the way:
* Correctly return false instead of 'infinity' for
getRestrictionExpiry( 'create' ) on an existing page
* Correctly handle non-special pages that can't exist (like media pages)
in listApplicableRestrictionTypes() (return empty array instead of
'create')
* Improve readability of isProtected()
The expectation change in TitleTest::testIsProtected() is because the
test was formerly broken, since it set mRestrictions without setting
mRestrictionsLoaded. (Which illustrates how this approach to testing is
essentially broken.)
Co-authored-by: Vedmaka <god.vedmaka@gmail.com>
Bug: T218395
Change-Id: Ia73ea587586cb69eb53265b2f8f7a296a2573dd0
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These not only make the code more robust, but also help a lot when
writing unit tests: if a method is return-typehinted and its class is
mocked, the mock method will automatically return a mock of its declared
return type. Otherwise it will return null, and developers are forced to
manually mock the method if the return value is used by the SUT in a way
that doesn't accept null.
Depends-On: I628fcb1807133390c7b9b47984f512f5b1ae58d0
Depends-On: I7080bc505f5838b2f51a368da562104e206063b0
Change-Id: I59068cfed10aabf6c6002f9e9312a6ef6e7e9441
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per docs added in I18767cd809f67b, these don't need normalization
as they are only compared against predefined strings, and besides
are generally entered manually in a form, and even then would not
require the kinds of Unicode chars that have multiple/non-normalized
forms.
In nearby areas to also fix some trivial cases:
* getVal('title') obviously needs normalization.
Use getText() to make this more obvious.
* getVal() compared against simple string literals within the code
obviously don't need normalization (e.g. printable === 'no').
* Change hot code in MediaWiki checking for whether 'diff' or 'oldid'
are set to getCheck (which uses getRawVal) instead of getVal.
As a bonus this means it now handles values like "0" correctly,
which could theoretically have caused bad behaviour before.
Change-Id: Ied721cfdf59c7ba11d1afa6f4cc59ede1381238e
|
|
|
|
|
|
| |
Found by sonarqube
Change-Id: I3464d25e94d98aaca55d9209d5175542b335f994
|
|
|
|
|
|
|
| |
Some minor updates I collected in my local dev environment the
past months.
Change-Id: I30d5339bc262d54ba76e2860a3a3e9e5f002fdc3
|
|
|
|
|
|
|
|
|
|
| |
Title::resetArticleID() clears various caches and is meant for when a
page was inserted or moved or similar. I can't see any reason that it
needs to be called by Title::castFromPageIdentity. Doing so wastes
resources and prevents use of the method in unit tests. It is also
surprising for a cast to have side effects.
Change-Id: I71c523e7406d493c52199c3a5a9ca7cd414bb5eb
|
|
|
|
|
|
| |
No callers, deprecated in 1.34.
Change-Id: If2e1c762f91e3c8255fbb58b7c9f01e8929a7fa2
|
|
|
|
|
|
|
|
| |
Changed format to TODO: so modern IDEs
will be able to guide developers to the
TODO
Change-Id: I40c47d5dfe976752812a986a3284d978b794f144
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First step here is to avoid accessing the Title class members directly.
Instead, use their corresponding accessor methods. Affected members are,
$mTextform, $mUrlform, $mDbkeyform, $mNamespace, $mInterwiki, and $mFragment.
TODO: The next step from here would be to find usage of direct access and
replace them with calls to accessor methods while making the members
private.
Bug: T275763
Change-Id: I9b3efe7a43597f14e19d5db8e824f65aeb169d0b
|
|
|
|
|
| |
Bug: T285951
Change-Id: Ifa04da54da8acdede6258330110d49453a8fffc3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* yeild -> yield
* paramter -> parameter
* seperator -> separator
* neccesary -> necessary
* inital -> initial
* intial -> initial
* repsonse -> response
* retreived -> retrieved
Bug: T201491
Change-Id: I461941b027590997448f3bdd8a137a48bb338beb
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
|
|
|
|
|
|
|
| |
This is just a start.
Bug: T254646
Change-Id: I9213aad4660e27afe7ff9e5d2e730cbf03911068
|
|
|
|
|
| |
Depends-On: If27bb6b5142d09bc9293d080e97b6642462219f4
Change-Id: I37f012e53d1c881292a19aac87eb107636c6bfbe
|
|
|
|
|
| |
Bug: T281337
Change-Id: I2e8d18b2fc10509097f66287b2543217f4eb9b6a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following methods no longer support Revision parameters:
- CategoryMembershipChange::__construct
- ContentHandler::getUndoContent
- DerivedPageDataUpdater::prepareUpdate
- DifferenceEngine::getRevisionHeader
The following methods were removed entirely:
- Title::countAuthorsBetween
The following methods return arrays that formerly include
a 'revision' key that would emit deprecation warnings when
accessed and return a Revision object. The Revision object
has been removed from the arrays, and the 'revision-record'
key should be used to get the relevant RevisionRecord instead:
- PageUpdater::doModify
- PageUpdater::doCreate
- Parser::statelessFetchTemplate
The ParserOptions `templateCallback` option is a callback
that is called in Parser::fetchTemplateAndTitle() and should
return an array - the 'revision' key to that array used to
be a Revision object and was used if no 'revision-record'
was returned - it is now ignored.
Bug: T247143
Change-Id: I163ada88d649c75697aff4fa31a3a3c0bdef78b7
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I78cca816915f64b84434c5c6d36da49df10e7de0
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- EditPage::$mBaseRevision
- EditPage::getBaseRevision()
- Title::getFirstRevision()
- LinksUpdate::setRevision()
- LinksUpdate::getRevision()
- Article::$mRevision
- Article::getRevisionFetched()
- WikiPage::getOldestRevision()
- WikiPage::getRevision()
- ContribsPager::tryToCreateValidRevision()
To make things easier, instead of rewritting
the Revision tests that were using WikiPage::getRevision,
just delete them, its not worth the effort to rewrite
them since the class is going away. For the WikiPage
tests, replace uses of getRevision with getRevisionRecord,
manually converting to a Revision object where needed
Bug: T247143
Change-Id: I52bc1f49649f8bd25797e3f7a090bec9c63ac2d1
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| | |
Bug: T281497
Depends-On: I271960cbbbbb5db73aae36414a4c18c14940b6e1
Depends-On: I0f7a82191eae8edd4c0c1d16d89c81e601ae5c80
Change-Id: Ibb83ac71fc2214dcc71f73f009d137a2e5c80d0d
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Typehinting parameters that take the return value of these methods
with Language is not safe as they may return global $wgLang which
may or may not be instance of Language.
Bug: T278429
Change-Id: Ia5a71e4c39124f4427bd816e6e19207bb371cc6b
|
| |/
|/|
| |
| |
| |
| | |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | | |
Bug: T278459
Change-Id: I144ea130f29ec437302649d86494034af044c524
|
|\ \ \
| |_|/
|/| |
| | | |
$wgActionPaths"
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
$wgActionPaths
Before this change, all main page tabs with a custom action path go nowhere (href="/") when $wgMainPageIsDomainRoot = true
Bug: T270004
Change-Id: I96f2a73cda39c5670ae93dad6396bb8791209c78
|
| |/
|/|
| |
| |
| | |
Bug: T278459
Change-Id: I78c6a1b57e1b8383905e6650ab16085d28a38769
|