This makes the hook name consistent with GetDoubleUnderscoreIDs, and
is part of a set of related documentation changes clarifying the difference
between "magic words" (a localization infrastructure) and the various
functions which use magic words for localization, such as parser functions,
double underscore variables, magic variables, etc.
See also I621c888e3790a145ca9978f6b30ff1a8f685b64c.
Change-Id: Ie2a6df4b179a360fb7cdfb219e915bedff501d1d
BaseTemplate should not handle anything but rendering.
In order to allow replacing it with another renderer,
such as Mustache or Vue, its hooks should be moved to
the Skin class instead.
BaseTemplateAfterPortlet is soft deprecated to allow
filtering, preventing the hook from running twice.
Both BaseTemplate::getAfterPortlet and ::renderAfterPortlet
have been deprecated as well, with both now calling
Skin::getAfterPortlet after running the
BaseTemplateAfterPortlet hook.
Bug: T253797
Change-Id: I438daa79d3d97e2518e6258c3213a805bd1f30e8
Although it's true that Parsoid doesn't (yet) support this hook, and
the $parser object referenced in the hook is likely going to be changed,
this is a hook added in 1.35 (eb6c5f70d9)
to replace use of an even worse hook. So let's keep the lesser of the
evils, at least for now.
Bug: T236809
Change-Id: I8f866c3b9f1fc51848cfe9364635112371d18e3e
Param 'bar' was renamed to more descriptive 'sidebar' in the interface. The change should be reflected here.
Change-Id: Icdb57a4f801272d408161503d330f3260291c579
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