Hard deprecation of passing Revision objects will follow soon,
but until that is ready core calls can be updated
There is some code cleanup that could be done around the calls, but
to simplify review no other changes are made.
Bug: T249561
Change-Id: Ifcfb3811650decffeaa87dc033c41fd1710b47a6
This is a collection of random bits from my local stashes. This patch
intentionally only touches comments, no code.
Notably:
* Use more specific string[] instead of array, if possible.
* Some comments mention "or null", but miss to list the type.
Change-Id: I712b28964f125c8e3dcb4e3fb993757a09f96644
Adds accessibility context to the automatically generated table
of contents div for a page. The div's role is navigation, and
its label is the heading "Contents".
JAWS, for example, can navigate to the table of contents by
region, and announces it as "Contents navigation region".
Bug: T139221
Change-Id: Ie9b291301f683d2be2cb2134f9d6ae3f7a6d831b
This updates some code that has been constructing TitleValue directly
to use TitleValue::tryNew or TitleParser::makeTitleValueSafe.
Bug: T200055
Change-Id: If781fe62213413c8fb847fd9e90f079e2f9ffc9d
Phan can treat scalar types as non-interchangeable with
`scalar_implicit_cast` set to false. This patch fixes some of those
issues (which are in total >1000), namely the ones with alphabetic order
< includes/actions.
Change-Id: Ib1c6573ab899088bc319b9da9ceaffc850da3dbe
RepoGroup::singleton() results in
MediaWikiServices::getInstance()->getRepoGroup()
Also avoid getting the service in loops, doing it once before the loop
is cheaper
Change-Id: I29e0c7487e3e498559ff16a567e2fad0c0f8bb69
The call of wfGetLangObj( $lang ) is not necessary anymore.
$lang still defaults to user interface language on unset parameter.
This change is a follow-up to I15b65fec987641885374dfef9e1229ea405f7c30.
Change-Id: I6f12097a0e6cf7d6035d1164092c8b87c58e2bee
The test was intended to check for whether we have a user ID *or* a user
name. Instead, it's checking if we have a user ID *and* a user name. And
it also failed to consider User:0.
Bug: T227656
Change-Id: Ia1b5c4a6ae028513b73a65cd2c885459327d29c3
Fixes a wfFindFile/wfLocalFile mixup in I9437494d.
Also restore the original behavior in Linker::makeBrokenImageLinkObj
for paranoia - findFile has a local cache so calling it and then
discarding the results is not completely a noop.
Bug: T226448
Change-Id: Ibb9d6f6383eb96ba27e0edd60423552e5cea4688
These global functions were deprecated in 1.34 and services made
available to replace them. See services below;
* wfFindFile() - MediaWikiServices::getInstance()->getRepoGroup()->findFile()
* wfLocalFind() - MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile()
NOTES:
* wfFindFile() and wfLocalFind() usages in tests have been ignored
in this change per @Timo's comments about state of objects.
* includes/upload/UploadBase.php also maintained for now as it causes
some failures I don't fully understand, will investigate and handle
it in a follow up patch.
* Also, includes/MovePage.php
Change-Id: I9437494de003f40fbe591321da7b42d16bb732d6
If an actor table row has neither an actor_user nor an actor_name
value (which should not have happened, but did), we would call
Linker::revUserTools() with no valid user info. This generated
log noise and displayed bad output. Instead, check for valid user
info, and fall back to a default message if necessary. T225469
exists for correcting the underlying bad data, but adding this
check is still prudent.
Bug: T224368
Change-Id: Ib9816d8b87b995f4fe465004acd608225728e391
Aka: Streamline Linker::formatAutocomments() and add tests
This uses the "streamlining" for the code proposed by Thiemo
in I38edc1ad7720. I have squashed the two commits, so it now
has his code in Linker, but still has my tests as well as his.
Thiemo wrote on his patch:
This also changes the output in case there is no fragment to link to.
Before an empty `/* */` in a summary this would have created a link to
the page. I would like to argue this is not what a user expects.
Bug: T222628
Change-Id: I05408ede0e20dfd976f4057fc5baab461d2ef769
Change ddd1d4b920 added logging when an empty username is
passed to various Linker.php functions. The logging revealed
this occuring on live, but it is occuring frequently and
causing distracting log noise. Switch the logging type from
warning to debug while the root cause is investigated.
Bug: T224050
Change-Id: I93826e486951e992afdf778f446792d3c209996a
Follows-up b6e1e99bec, which switched the method from Title::makeTitleSafe
to TitleValue. The latter throws fatal on non-string $fragment.
Title::makeTitleSafe, on the other hand, uses makeName(), which casts
$fragment to a string, and ignores if it ends up as empty string
(boolean false becomes empty string and thus did "the right thing").
Bug: T222857
Change-Id: Iecc2140fabd31ef0f193740c7fab0fc698c38e51
Historically it seems that if Linker::userLink or friends were passed an
empty username (probably due to an incorrect database entry), they would
produce bogus output, e.g., an <a> with no contents or a link to the
invalid page "User_talk:" or similar.
In b6e1e99bec we replaced an occurrence of Title::makeTitle() (no
safety checks!) with creating a TitleValue, which asserts in its
constructor that the title text is not empty. This made such pages fail
an assertion and stop displaying at all.
Now there's a proper check for the error. Such cases will log a
production error and return "(no username available)".
Bug: T222529
Change-Id: Id65bdf9666b0d16e5553b8f38c7cf8fce2e37a25
This function had been changed to unconditionally disable parentheses,
but none of its callers load the CSS needed to make that work.
Bug: T220767
Change-Id: I566d65e155258d3bd1a1a06bca9aa2b3a2d417ee
Follows-Up: I6eeeaa3b58d37adb7fefb4cc6915022229b3b324
Even if a revision has been deleted and the history-deleted class is
being used, the original class for its corresponding element when
not deleted should be applied. This is important as it allows skins
to skin consistently. "history-deleted" is a modifier class - it provides
further information on the original meaning.
This blocks styling the history page from core in Minerva skin
Bug: T216420
Change-Id: Ia659606838d7e38bc09054e36cd980b00f5e6da9
This patch removes the temporary rollback confirmation toggle that was
implemented to allow certain wikis to disable the rollback confirmation
feature while still showing the option in the user preferences.
For reference:
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/494249
Bug: T217437
Change-Id: I001d7927f6f44a4cc517a80b71f5b83aca33824c
This code is functionally identical, but less error prone (not so easy
to forget or mix these numerical indexes).
This patch happens to touch the Parser, which might be a bit scary. We
can remove this file from this patch if you prefer.
Change-Id: I8cbe3a9a6725d1c42b86e67678c1af15fbc5961a