CommentParser:
* Move comment formatting backend from Linker to a CommentParser service.
Allow link existence and file existence to be batched.
* Rename $local to $samePage since I think that is clearer.
* Rename $title to $selfLinkTarget since it was unclear what the title
was used for.
* Rename the "autocomment" concept to "section link" in public
interfaces, although the old term remains in CSS classes.
* Keep unsafe HTML pass-through in separate "unsafe" methods, for easier
static analysis and code review.
CommentFormatter:
* Add CommentFormatter and RowCommentFormatter services as a usable
frontend for comment batches, and to replace the Linker static methods.
* Provide fluent and parametric interfaces.
Linker:
* Remove Linker::makeCommentLink() without deprecation -- nothing calls
it and it is obviously an internal helper.
* Soft-deprecate Linker methods formatComment(), formatLinksInComment(),
commentBlock() and revComment().
Caller migration:
* CommentFormatter single: Linker, RollbackAction, ApiComparePages,
ApiParse
* CommentFormatter parametric batch: ImageHistoryPseudoPager
* CommentFormatter fluent batch: ApiQueryFilearchive
* RowCommentFormatter sequential: History feed, BlocklistPager,
ProtectedPagesPager, ApiQueryProtectedTitles
* RowCommentFormatter with index: ChangesFeed, ChangesList,
ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges
* RevisionCommentBatch: HistoryPager, ContribsPager
Bug: T285917
Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
Updates for the removal of the Revision class itself
and the various methods/hooks/variables removed in the
process, including:
- Update some documentation removing most references
to the Revision class and updating the MCR migration
notes to reflect the past tense for Revision methods.
- Change some capitalization from "Revision" to "revision"
to make it clear comments are about revisions in general,
not the Revision class in particular.
- Minor code tweaks including removing unused variables that
were around for the old hooks that were removed, and
removing the use of DeprecatablePropertyArray where no
longer needed for anything.
- Fix incorrect documentation for PageUpdater::getStatus(),
the status value changed a while ago to have revision-record
in addition to revision, and recently to only have the
revision-record, but ironically PageUpdater was never updated.
- Removed Parser::$mRevisionObject, used to be a Revision object
and was deprecated in 1.35, missed earlier because it was no
longer being set to Revision objects, always null.
- Add RevisionRecord typehints in DummyLinker to match those
in the corresponding Linker methods
This should be a no-op in terms of functionality.
Bug: T247143
Change-Id: I03bbb94fc29085855448780b1a5ad9063911ecc4
This also tries to centralize adding logic of adding history-deleted
class as well. To make future changes easier.
This doesn't affect history deletion on files, recentchanges, and logs yet
Bug: T23272
Change-Id: I08f14f712479e1b170c606e2b64857f8386acd76
Code that needs to store an actor ID in the database to
represent a UserIdentity, or needs to construct a UserIdentity based on
an actor ID loaded from the database, should use the ActorNormalization
service.
Note: The getActorId() method is removed from the UserIdentity interface,
but all concrete classes continue to support it for now.
UsererIdentityValue::getActorId() is hard deprecated and should
be removed in 1.37. It always returns 0.
User::getActorId() is not deprecated at this point.
Bug: T274179
Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237
Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
The markers for minor, bot, unpatrolled and new page edits used to
be bolded, but weren't after I3f45c95d2856c8fce2da5175b52089d4e629a41e.
Move the relevant styles to mediawiki.interface.helpers.styles, which
is used on all places where these markers can be found.
Bug: T279099
Change-Id: I7af935da13669b6519ba770b413cb1ef027cac1c
I keep fixing type hints in my local dev environment whenever I
see something that is worth updating. This is what I collected
over the past weeks.
Change-Id: Ia4f1b4bee2019abe4ab0fb0df8164e1b446229e7
The ActorNormalization factory methods create
UserIdentityValue from the database rows, either via
fields of a joined table, or via a row from actor table.
They assume that the actor_id exist and throw othervise.
ActorNormalization is a storage-layer service providing
access to finding and acquiring actor_id.
The UserIdentityLookup methods do not instantiate new actor
on demand, they just find an appropriate row in the actor
table and return the result.
Bug: T272689
Depends-On: I74d81f3f0233efb17fc8df5178e4c477cc669c6f
Change-Id: Icfa1daca960c696a8cef8adab5eab53985802858
This includes fixing some mistakes, as well as removing
redundant text that doesn't add new information, either because
it literally repeats what the code already says, or is actually
duplicated.
Change-Id: I3a8dd8ce57192deda8916cc444c87d7ab1a36515
Add a new resource module for watchlist expiry behaviour in
changes lists, to add a message when the clock is clicked on
mobile.
Bug: T261415
Change-Id: I621b1571b57686beb9fb5802533b1e70d293bc2a
Update watchlist expiry language indicators (dropdowns, tooltips, watch
via star, watch via edit):
* Change "Permanently" to "Permanent"
* Change "XX days left" and "Expires in X days" to "XX days left in
watchlist"
* Update the "Click.." sentence by star to "Click to remove it."
* Change watch period for a page that is less than "1 day left" to "A
few hours left"
Bug: T253135
Bug: T255632
Change-Id: I114c6f77e86ad81b1810fedcd49f52c88700ca16
Extend the watchlist expiry clock icon from Special:Watchlist to
also be displayed on Special:RecentChanges for expiring watchlist
items.
Bug: T258310
Change-Id: I254570addd1835119c863639111bd5394cb4b697
This query was correctly excluding expired items from RC, but it
was failing to include them when the unwatched filter was set.
This is a follow-up to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602211
Bug: T252136
Change-Id: I5d43d746df21cc3674eb2e92c3f604b7c87b7d1a
If a changeslist item has an expiry date, add a grey clock icon
after the page title, with a tooltip indicating when the item
expires.
Bug: T250212
Change-Id: I38f8c85321cf257eeea8de5a3bd73bbc0b5ea393
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Migrate ChangesList and subclasses from Hooks::run() to the new system,
as a pilot for full migration.
Change-Id: Ic2d408fdb108087d81d0981aa670b35e0a6bb0ce
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
The change to ChangesList::revDateLink is not backwards compatible,
because the method was marked as @internal
Due to a breaking change in HistoryPager::revLink, and the fact that
it didn't have a visibility defined, it has been made private
Bug: T246284
Change-Id: I2f1309fda1c312a6cf634de48ad0bbcfcb2d83ae
The contributions and history page was showing some semicolons in unexpected places.
These unwanted semicolons are now supressed by reverting to a new standalone element
in exactly the same place as the previous semicolon. This avoids the issue of
ordering that we hit before.
I have documented the behaviour of the semicolon separator in contribpager pages
My seemingly harmless change in Ic4508788299a13c4c830f447141d17d99ebe002e
For future generations I have encapsulated what I've learned in extensive
comments which seem important given the information I have acquired while
working on this patch.
Bug: T233649
Change-Id: I9723ead1815685a9cbcccf2c4e2f3ffff36dcee3
Entries such as "User creation log" on Special:RecentChanges can
be wrapped or not wrapped in parentheses
Bug: T219348
Change-Id: Ic764081497dbe8d6d9e5bff6f8a1ceeac4b306e2
This allows us to remove many suppressions for phan false positives.
Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
These filters provide a shortcut to see or highlight all entries associated
with a subject or a talk namespace.
They are defined as real filters on the client-side and are superset
of all other namespace filters.
They are expanded to the list of namespaces they represent on the server-side.
Bug: T201520
Change-Id: Id9e04a38c2d7c8165c27af98959aa5715225faa8
Log entries are wrapped with parenthesis - not hardcoded into HTML
causing stray brackets in Minerva where this element is floated.
Has no impact on other skins
In addition to this the entire log entry item is wrapped in a new
span mw-changeslist-log-entry to ensure the text is recognised
as a whole entity - on Minerva floats were leading to the action
and the action object being separated (e.g. uploaded and "File:Name
were separated
Bug: T229360
Change-Id: Idae997b15f68bb0dfcaa857f7458ba3497233d41