This will allow us to style NewPages consistent with other Minerva
special pages.
Update getStartBody and getEndBody to be consistent with ContribsPager,
now that the output of the UL is output by mGroupByDate
Bug: T360843
Change-Id: I3424d8f4f7a40ff60827065e83532315ba35dfd3
When OldChangesList is used, the mw-changeslist-line-inner that the
mw-changeslist-links is nested in is a span.
mw-changeslist-links is formatted as inline-block in skinStyles.less as
it is.
Bug: T275230
Change-Id: If97aa95472a73fce1f73c65dfcad961d24cf7e37
Merged duplicate branches in the switch statement related to the
RecentChange::SRC_NEW case, combining them with existing cases
for RecentChange::SRC_EDIT and RecentChange::SRC_CATEGORIZE.
Change-Id: If09288dcfdf40b4cf095a568eacac3621956e063
They're under 'specials' because that's where they're mostly used,
but they're just another kind of Pager (shown by their use outwith
the MediaWiki\Specials hierarchy, which is a bad code smell for us
to review later).
Bug: T166010
Change-Id: Iad3f91582b723c1e6679525aa852ffdfd8c6d5ba
Follow up to a468534. The caching added to RCCacheEntryFactory
would be utilized only by EnhancedChangesList. This should
improve performance for OldChangesList, too.
Bug: T341319
Change-Id: Ibb1907732c71d0783d1a627063debb2a484cafe7
Also split the cache by context, like it's done
in ::insertTags. Follows-up 17deb8353b (I0b5e48ef5).
Change-Id: I5b539a63c3210a8cd1debb2ba625b0f2dedacc39
Rendering UserLinks or Tags requires parsing, which when run on thousands of records, adds up to a significant amount of processing time. More often than not, this can be optimized by storing already visited tags or user links as those "renders" will not change for the single request run and are repeated constantly on the list.
Bug: T341319
Change-Id: I91588aebae7e49e3d3cb77702cf28677b4a14c8d
When the value of the associated array is not used, there is no need to
use array_keys and create internal a copy of the array, just omit the
value with $_ to tell static analyzer that the var is unused.
Change-Id: I5c6d667e98c0167c0573c683f0d617bc1d4ca619
The Hooks class contains deprecated functions and the whole class is
going to get removed, so remove the convenience function and inline the
code.
Bug: T335536
Change-Id: I8ef3468a64a0199996f26ef293543fcacdf2797f
Follows up Ia03038e86c6a607c8b75eefedbf0285ca1a2f8c8.
* Only generate a rollback link for the latest revisions in
ContribsPager.
* Gate the entire ChangesList::insertPageTools beind the RC
attribs check, not just the rollback link generation.
* In ContribsPager::formatRow, check for the existence of $page in
a more reasonable place. This was already broken before Ia03038e
so I suspect $page is never null in practice (in theory, a
ContribsPager__reallyDoQuery hook handler could somehow produce
a $row with no title information), but it can't hurt.
* Add some documentation and FIXMEs.
* Remove a comment from ChangesList - part of it is not true
anymore after Ia03038e, part of it already didn't make sense
before that.
Bug: T51541
Bug: T325753
Change-Id: If848e38b568492579382a2c920cb865fb0326d99
The history page renders an extensible list of tools for each
change list row. I've factored this code out so that it
can also be used on other pages that use the Pager class.
This generalizes the logic for the rollback link and makes sure
the control is standardized across pages. It also allows
the onHistoryTools hook run. I suggest we rename this to something
more generic in a follow up.
Right now usages of onHistoryTools are low but there should be
no issues with running it on more than the history page. One of
the benefits of this is the thanks link will now show on the
contributions page, watchlist and recent changes.
Bug: T51541
Change-Id: Ia03038e86c6a607c8b75eefedbf0285ca1a2f8c8
The motivation is to make the code less confusing. I hope this is the
case.
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.
Change-Id: Id807affa52bd1151a74c064623b41d950a389560
Pass along a revid to category changes on Special:RecentChanges
This change allows IPInfo downstream to pull the revid for use in
its subsequent API call
Bug: T310813
Change-Id: I533d5fffd64dc741d5b28563f9e0c0827a48906c
Add action links for deletion and protection on Changeslist.php.
This will make links more consistent with the log page entries.
Bug: T49466
Change-Id: Ic1fdb2b4280bdeac521323aafe4548819778c870
This covers all occurrences of /onfig->.*get( '/ in includes/.
Undoubtedly there are still plenty more to go.
Change-Id: I33196c4153437778496f40436bcde399638ac361
It turns out this gets rid of a bunch of suppressed
"SecurityCheck-DoubleEscaped" that appear to have been accurate
warnings.
There seems to have been some confusion about how ::truncateForVisual()
is supposed to be used; in particular it is to be passed *unescaped*
output, because it is not (generally speaking) safe to truncate
HTML-escaped strings. The goal of ::truncateForVisual() is to have
a specific number of codepoints in the output for display purposes,
the encoding of those codepoints is not an issue (htmlspecialchars
can be applied to the *return value*.) If you need a specific number
of *bytes* you should be using ::truncateForDatabase(). If you want
a certain number of *HTML bytes* then the ::truncateHtml() method
is probably what you want.
Slightly refactor some code in RevDelLogItem to avoid a false positive.
Bug: T301205
Bug: T290624
Change-Id: I893362e049aedfa699043fcf27caf4815196f748
Follow up to I0cba011f0ab8cb8fd59962b5eafb7650deefe841
This class is usually used for dates.
In Special:Contributions an additional class is used for times
so let's use that here.
This will be helpful for T219349
Change-Id: Ibd5cff5cc37bec8eb840d7f0479fcb4eb8346611
For comment and content the class mw-history-suppressed is added
additional, should be the same for the user.
Follow-Up: I08f14f712479e1b170c606e2b64857f8386acd76
Change-Id: I7d477913952b9cc67314d1ec96f83db2846a74cb
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