This is the first patch in that direction, and for now, the code is
**only moved** with minimal changes, to keep the diff small and make it
easier to review. More patches will be sent to clean up this code,
before moving parts of it to a separate service.
Article::delete() and friends were hard-deprecated, given the lack of
callers according to codesearch (searched in "Everything").
The logic for varying the form depending on the page type is also being
moved to DeleteAction, which means there's currently no way for
extensions to customize that (and I couldn't find any extension doing
that at the moment). Should we need this behaviour, we could add a hook to
DeleteAction to allow altering the form.
Bug: T288282
Change-Id: I34525cf3e7c9a82032101b8c2e7b14d6dff59092
This is the first patch in that direction, and for now, the code is
**only moved** with minimal changes, to keep the diff small and make it
easier to review. More patches will be sent to clean up this code,
before moving parts of it to a separate service.
Article::delete() is being removed since there's going to be no
reasonable way to maintain BC, and it's also unused (which I think is
expected, given how many things that method would do).
The logic for varying the form depending on the page type is also being
moved to DeleteAction, which means there's currently no way for
extensions to customize that (and I couldn't find any extension doing
that at the moment). Should we need this behaviour, we could add a hook to
DeleteAction to allow altering the form.
Bug: T288282
Change-Id: Iadb8137d728f4fd4e749a1052f8aef4bab11ec09
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
When calling PermissionManager::isBlockedFrom, don't query the
primary database when only showing UI elements.
Bug: T283268
Change-Id: I9a79badf8a7cfb6afc7b4d12e4f1fbb5c24b6a86
Instead of always (except when reading from ParserCache),
using the latest version.
This can also clearly be seen by visiting an old revision on
Wikipedia (https://en.wikipedia.org/w/index.php?oldid=N)
and looking for "This page was last edited on …". When first
loading the old revision, the TS of the last rev will be shown,
upon reloading, the correct time will be shown (as the output
is fetched from parser cache).
This reverts the test removals from I83a43d651.
Bug: T282648
Change-Id: I517d4970d5c682489f27a65ba01ee30db9c62276
This should not default to latest revision id, but
Article::getRevIdFetched() if the ParserCache doesn't
have the id set. Also set the revision id before calling
OutputPage::addParserOutput to make sure the id is
already set when the "OutputPageBeforeHTML" hook is run
(which is the case in other code paths).
Additionally I've made the tests more robust, by no
longer manually getting the revision into parser cache.
Bug: T281587
Change-Id: I999195441f9d75a7e4bde4d843ad7729cdb1bee0
In order to allow Authority to know about user blocks,
we need a narrow interface to represent such blocks.
This deprecates some methods on AbstractBlocks in favor
of new methods on the Block interface that avoid binding to
the User class.
Bug: T271494
Change-Id: I7bb950533970984a014de0434518fbbefb695131
- 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
This module is used almost everywhere these elements are found.
Methods in Linker that produce these elements list that this module
is required for proper styling.
Where possible, the module is added to retain the styles.
Bug: T278576
Change-Id: I7dedebd3bce3b4aec127738edc81b180325f0836
These are styles for actions that do not have a dedicated style module.
Given that the amount of css it contains it marginal, creating a
dedicated module for each action would be overkill.
Bug: T278504
Change-Id: Id03c81e7d5ebf179731649aa230def2e8e21ac02
User::getBoolOption() is deprecated and should be replaced with UserOptionsLookup::getBoolOption()
Bug: T277600
Change-Id: Ife3c721237258d50852bbf764def74657cc70428
This hook allows discussion tools to toggle a parser option based on
artice title (namespace) and user identity. In particular, it sets a
flag to generates reply links (a) on talk pages (b) if the user's
preferences opt in to discussion tools. Other extensions may also
wish to be able to customize article parsing based on title or user.
Change-Id: I883a37fd67108243e7a20683b1a5d59fd0f6e39f
When viewing Special:Contributions for a hidden user and
a missing user, or the user page of a hidden user and a
missing user, if the viewer cannot see hidden users
the output should be the same for hidden users and
missing users.
To that end
* In OutputPage.php, only set the `wgRelevantUserName` javascript
variable if the user is not hidden, or the viewer can see hidden
users
* In Article.php, show the `userpage-userdoesnotexist-view` on user
pages of hidden users if the viewer cannot see hidden users
* In Skin.php, do not add user-specific sidebar links (contributions,
logs, mute, etc.) if the user is hidden and the viewer cannot see
hidden users
* In SpecialContributions.php, stop calling Skin::setRelevantUser
for non-existing users, so that callers of Skin::getRelevantUser
can ignore users that are hidden from the viewer without creating
divergent behavior
* In SpecialContributions.php, for users that do exist but are
hidden from the viewer, don't show `sp-contributions-footer`,
but do show `contributions-userdoesnotexist`
Bug: T120883
Change-Id: I83b723402f315447bc4b50992e28620e3daace8f
The styles can be removed as there are no caching implications here
If a skin is loading `legacy` feature or providing its own (e.g
Minerva)
Non-Wikimedia skins loading content but not legacy will lose
styling here, but that will be consistent with other message
boxes in the interface.
Bug: T269797
Change-Id: I5cfa9d83bedd2786d65d835c1f7623b7a61317c4
The method is called from two places:
- For new revision ParserCache, when the subtitle doesn't need
to be applied. That call is protected by !oldid check
- For old revision cache, when subtitle is already applied before
checking the cache. So, no need to set it.
Bug: T269727
Change-Id: Ibec845ccfe43ae2cb4bbe0152c932cb74f3cef4b
The only place where this was used is to show the system
message contents on a missing article page in NS_MEDIAWIKI
namespace, which is much easier done without MessageContent.
The override in ImagePage is a guaranteed no-op, cause we can't
have ImagePage for NS_MEDIAWIKI namespace.
These were the only two places where this method was used across
codesearch.
Change-Id: I9b9be61eaff6d153fbd2381c91c598b3421e5ea2
Hard-deprecate getContentObject since it's used in a few
non-wmf extensions. Drop the rest, since they're unused.
Depends-On: Id0a6eab1e31591c5a6b00fe6135b9747afa7f44b
Depends-On: I352dbcc31643567d12ccf1892ce4fee7d5d2f474
Change-Id: I79f590c385402859b26e9b7ea3927f4357abee9f