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
* Change export schema to allow "sha1" attribute in <text> tags nested
in content tags. This was apparently overlooked when adding the location
attribute to the <text> tag for the main slot.
* Change XmlDumpWriter to only output text row IDs in <text> tags for the
main slot. Backwards compatibility is not needed for <text> tags nested
inside <content> tags.
Bug: T246074
Change-Id: I5e2bd28cc346d4a3cdc5e2dd5119eca5609385a7
Synchronize the definitions for ResourceModules and QUnitTestModule.
I previously had to fix a similar problem with 'packageFiles':
I6c3d186de1877f73d4a4e3fec7d6d632a5d5fa83. And there are many other
differences. I don't have the time right now to compare them all
and decide which ones are right.
Change-Id: I9153851fe162c012967fda00d3e1f81964a8dce9
Was deprecated in 1.28 and removed, so it need not be mentioned as
an alternative to `UploadVerifyFile`
Bug: T220656
Change-Id: Ic1c78a0216ca6f03099c1e8433297418f3d50172
KSS is no longer in use anywhere. The only official style guide is
at https://design.wikimedia.org/style-guide.
Change-Id: I688a78e9a71a082c499af55bd01e8fd615130486
Turn this into a doc group, and let the descriptions come
directly from the files in question. This makes the list easier
to maintain, and alsom means that the overview page becomes
discoverable whenever one is looking at the entry point file
as well. Previously the doc page pointed to the entry points,
but not the other way around. This is also fixed.
Bug: T244294
Change-Id: I891c5a37e17592edc1136d7367949927121c8bc8
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
All services required by LinkBatch are now injected by the
LinkBatchFactory. The constructor for LinkBatch has been
soft-deprecated, but the required services are still optional.
Bug: T239855
Depends-On: If49cbb730d4ac48586b891908cf24601efbc5d6a
Change-Id: I93d931ab60305ad49a6e419f8269c77791a3938d