Since the hook interfaces are not yet released and adding a parameter
to the hook is b/c, I have just added a parameter without introducing
a new version of the hook interface
Bug: T253149
Change-Id: Iac6c4b706ddbc7b0c9fb0b40eba05bd3530b1fdf
* The hook that's being deprecated is not used anywhere
in MW ecosystem.
* The getNewMessageLinks/getNewMessageRevisionId wasn't
ported to the service, only the DB lookup. The interface
of these two methods is extremelly weird, the idea is that
they should eventually be able to do cross-wiki lookups.
This doesn't belong in the service - with only a single caller,
these methods should be moved out of User and inlined into the
caller instead.
* There's been a little bit of preparation done to T146585#4233276
as the interface of setNewTalk was split into set and remove
with the idea that we gotta require Revision to be passed to
setUserHasNewMessages eventually. B/C is still maintained though
since service-conversion patches are not a right place for making
behavioural changes
* The tests are only integration tests since most of the logic
in the manager is tied up to the database anyway.
Bug: T239640
Change-Id: Ia0a52865970c11066d1089196251f62ffeaa53bb
By default, core adds those fields as null to each row.
provideThumbnail and provideDescription hooks are introduced.
Extension should subscribe on the hooks to provide a thumbnail and description respectively.
Bug: T250144
Change-Id: I42c6c8ff9d887a440174af2a21c7921573b06640
Since I8d825eb02c69cc66d90bd41325133fd3f99f0226, modification of the
$cond parameter to the ModifyExportDisplayQuery hook has had no effect,
since $cond is now incorporated into a condition array $conds. This
seems contrary to the purpose of the hook, although no extension in
CodeSearch actually depends on it.
It was also a documentation error, with the incorrect type on the
interface causing a Phan error in the HookRunner call site migration
patch.
So, add a $conds parameter to the hook, which allows modification of
the array, and fix the documentation.
Change-Id: Id4608cec35df56456d7dad4de107bbef816e964b
LocalisationChecksBlacklist and LocalisationIgnoredOptionalMessages
were removed, update hooks.txt
Change-Id: Ia2dc083a70bf5a7e0c121702cc09ace5bbb2b817
* Move the Title::getCdnUrls() logic to the new HtmlCacheUpdater service.
* Introduce a runtime option to decide whether this is for a direct
revision or a cascading LinksUpdate.
Bug: T250261
Change-Id: I514b9052761e0d949234996e97fdef255582df86
In the new hook system, it is invalid to have two hooks that differ only
in case.
This reverts commit afb5b38e15.
Change-Id: I160ece0a7bc68c748037b383137364b787be86a0
This will allow us to deprecate the ParserBeforeStrip and ParserAfterStrip
hooks by covering the one case where ParserBeforeStrip is called but
ParserBeforeInternalParse is not.
Bug: T250450
Change-Id: Ia298fecba77e97fc30dc30a09ac69a4239767d8c
Disabling tidy has been deprecated since 1.33. This cleans up the code
paths which still used untidy output.
Bug: T198214
Change-Id: I821ef3b8f59b272d983583d407b2f0794fe1e791
Old hook PageContentSave only received the main slot of the article.
In order for extensions to intercept changes in all slots, they should
receive a RevisionSlots object with new content.
PageContentSave hook is still preserved for backward compatibility.
Note: parameters $iswatch and $section (from PageContentSave) are
not added into the new hook, because they are obsolete in the old hook.
Note: new hook also doesn't unnecessarily pass-by-reference (T193950),
which was an issue with the old hook.
Bug: T205982
Change-Id: I55455639c5ff6ccbf3917d85c1ab0dac847ec853
Ensure that the value returned is always also added to the cache, since
we (eventually) want to remove the hook's access to
$parser->mVarCache. Also don't allow monkeying with the value passed
as $magicWordId, even though it's a reference.
Code search:
https://codesearch.wmflabs.org/deployed/?q=ParserGetVariableValueSwitch&i=nope&files=&repos=
Bug: T236813
Depends-On: Ia12faefada7e4cf04f1a6b12b3ed1703bf28e437
Depends-On: Ia9e2e00c6b7d0e62cbe80c3b124165b691b1ff3d
Depends-On: I1e48fa47b8723958d543a69aaf9b62b872200dc5
Depends-On: If9a0885a8664c22473ade712364c2dd0a5c04e0b
Change-Id: I3d6b281f8e4e0bf68eefbf9767047527b4573b79
Deprecated since 1.32, and no longer used anywhere.
It is referenced in ApprovedRevs, but conditional on a MW < 1.35
context only.
Change-Id: I415927f198473ae3e795fac8c4811690424f167a
This is needed to migrate an extension (AutoWIGO2) that uses ArticleSave
to a version of MW after that hook was removed. The extension was using
ArticleSave to do its own PST processing, which probably doesn't work
with PageContentSave, and wasn't really the right way to do it in the
first place. Surprisingly, there were no useful hooks in PST or its
callers.
Change-Id: If1b3d7ea130a2b77609afe206eedc8445e1ab9f9
The interface generator script now flags any differences between the
argument list at the call site and the documented arguments. Resolve all
such differences.
* In AlternateEditPreview, $parserOutput is a reference, and a
WMF-deployed extension replaces it.
* In DeleteUnknownPreferences, fix missing "$" in &$where
* In LocalisationCacheRecache, document the unused parameter, as is the
convention elsewhere in the file.
* In NewRevisionFromEditComplete, make all callers pass a $tags
variable, and document the fact that there are multiple callers.
* In PageContentInsertComplete, document legacy references
* In PageContentSave, document the fact that $flags and $status are
references. I made them legacy references, since although replacement
will have an effect, no extension relies on this and it is not
documented on the Manual:Hooks page.
* In PageContentSaveComplete, document $wikiPage, $user, $flags and
$status as legacy references. Replacement of $status was broken
by If610c68f4912e89 (MW 1.32), but I confirmed that no extensions
in CodeSearch are currently affected.
* In ParserGetVariableValueSwitch, document $frame as a legacy reference
* In WatchArticleComplete and UnwatchArticleComplete, SpecialEditWatchlist
was passing $user by value where as the other callers were passing it
by reference. Passed by reference. It was already marked legacy.
Bug: T240307
Change-Id: I33f69ebdb5242982fd7986d9877959d2d33149b9
Includes the new $wgWatchlistExpiry feature flag.
Consumers of WatchedItem and WatchedItemStore have not been changed to
make use of expiries, this along with associated UI changes will be done
in a separate patch.
Bug: T245213
Change-Id: Ifff5e56e0222bb325cf796e0aa3d88825820d1fd
In hooks.txt, annotate all parameters that are references for legacy
reasons with [&] instead of &.
This will be the canonical source of this information. After T240307
is complete, assignment through the reference (replacement) will have no
effect. So if any parameters are incorrectly annotated with [&],
extensions will break.
These changes are final, since T240307 will make it impossible to change
the reference type of an existing hook. The only recourse will be add a
new hook without the reference.
Full review notes:
* FileDeleteComplete: A case of inappropriate non-object references
introduced by analogy: the local variables are not consulted after the
hook is called. CodeSearch reveals that handlers already use non-ref
params, presumably due to T193950
* BeforeInitialize: Replacing the title here would have some effect, but
it is fetched from the context and not written back, so the result would
be inconsistent. Inadvisable.
* InitializeArticleMaybeRedirect: $target and $article are certainly
replaceable, but not the request-sourced variables $title and $request.
The correct way to redirect is to use $target.
* IsTrustedProxy: $ip inappropriate scalar reference
* ResourceLoaderRegisterModules: The contract is pretty clear here,
replacement would be difficult
* ActionBeforeFormDisplay: replacement seems inadvisable; no handlers in
codesearch
* PageHistoryBeforeList: inadvisable, no callers replace
* UnwatchArticleComplete: $user was called with & but undocumented
* APIAfterExecute: seems safe from codesearch
* APIQueryGeneratorAfterExecute: no handlers
* User::mailPasswordInternal: handlers do not use ref params
* FetchChangesList: replacement would have no effect
* ParserFirstCallInit, ParserClearState, ParserBeforeStrip,
ParserAfterStrip, ParserAfterParse, ParserBeforeInternalParse,
InternalParseBeforeSanitize, InternalParseBeforeLinks, ParserBeforeTidy,
ParserAfterTidy, ParserGetVariableValueVarCache,
ParserGetVariableValueTs, ParserGetVariableValueSwitch,
BeforeParserrenderImageGallery: undocumented reference
* BeforeParserrenderImageGallery: replacement seems inadvisable after
mutation. No handlers.
* RevisionInsertComplete: undocumented reference
* SkinTemplateOutputPageBeforeExec: $tpl replacement would be
inadvisable after mutation. CodeSearch shows many callers, I haven't
reviewed them all, but a sampling shows $tpl->set() being the usual
pattern
* SpecialPageBeforeFormDisplay: CodeSearch confirms this is harmless
* BlockIp: did CodeSearch to confirm that neither variable is replaced
* SpecialMovepageAfterMove: did CodeSearch
* UnblockUser: no handlers
* UndeleteForm::showRevision: extensions/Video actually tries to replace
it, but forgot to declare the parameter as a reference. Filed T246408.
* ArticleEditUpdates: $editInfo is unused after the hook call
* PageContentSave: undocumented ref params. $mainContent is unused after
hook call.
* ImageBeforeProduceHTML: $dummy is unused after hook execution. The rest
could be altered
Bug: T193950
Change-Id: I6ddf54cb6812d2e292eca6d8e588364498c2fe73
There's no other way to detect parameters, since variable names are
often mentioned in the description prose, even at the start of a line.
Change-Id: Ie375ecffaae4efa268c5305ea9b1cc55a91cd813
Was deprecated in 1.28 and removed, so it need not be mentioned as
an alternative to `UploadVerifyFile`
Bug: T220656
Change-Id: Ic1c78a0216ca6f03099c1e8433297418f3d50172
Introduced in 2015 via If83b062. Unfortunately the patch fails to mention
why the hook was introduced. A review comment asking for the missing
information was ignored.
The hook was introduced exclusively for the Cite extension, see I0e136f9.
The Cite change got reverted a few days later via I1a71854. As far as I
can tell the hook (oddly specific and underspecified anyway) was never
used again, neither for Cite nor for anything else.
Now unused: https://codesearch.wmflabs.org/search/?q=ParserAfterUnstrip
I suggest to just remove it with no deprecation phase.
My team is currently working on Cite, essentially turning it upside down.
I'm not aware of a need for this hook.
Change-Id: If68a88d7afff60385ff1e33fd13716b20d01a313
This will allow extensions/skins to alter the wiki pages that editors
can use to control styles
Bug: T237050
Change-Id: I329415b787136fcf9422a9deebfcd34f83b40f12