Commit graph

1181 commits

Author SHA1 Message Date
DannyS712
0c303967b1 Remove double newline in hooks.txt
Change-Id: Ib2bb7ead4e4f514c9561ca050014a4582eb34d11
2020-02-13 07:54:58 +00:00
jenkins-bot
4dbc276487 Merge "Remove ArticleContentViewCustom hook, deprecated and unused" 2020-02-13 05:13:11 +00:00
James D. Forrester
cafe286e2b Deprecate the ArticleEditUpdates hook
Change-Id: Ie85a46846315999ebaab1e1b38265937f4b2c79e
2020-02-08 20:29:35 +00:00
James D. Forrester
6a7ab1ed04 Deprecate the ArticleEditUpdatesDeleteFromRecentchanges hook
Bug: T244613
Change-Id: I2bb1645a8b5d99a5a3c4425f2bc0e8c3f524d4e8
2020-02-07 15:35:08 -08:00
DannyS712
f14fad3538 Remove ArticleContentViewCustom hook, deprecated and unused
Bug: T241351
Change-Id: Ie37ed9265511e3051ea60c6898febb567d5283df
2020-02-06 19:55:16 +00:00
Thiemo Kreuz
ea01e7cfbb parser: Remove unused ParserAfterUnstrip hook
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
2020-01-25 09:20:52 +01:00
DannyS712
0bbe0b8fe6 Docs: Update hooks.txt to remove usage of global $wgUser
Also remove 2 refernces to $wgOut and $wgRequest

Bug: T159299
Bug: T160810
Bug: T160812
Change-Id: I267dece08d6a2224091cbcb5d29e29bd9e9d3f07
2020-01-07 19:06:04 +00:00
jdlrobson
5b044bb928 resourceloader: Introduce hooks in ResourceLoaderSiteModule
This will allow extensions/skins to alter the wiki pages that editors
can use to control styles

Bug: T237050
Change-Id: I329415b787136fcf9422a9deebfcd34f83b40f12
2020-01-06 22:52:27 +00:00
Kunal Mehta
99007e96c7 Use namespaced IPUtils class
Change-Id: I047e099a93203a59093946d336a143d899d0271f
2020-01-01 02:36:49 -08:00
jenkins-bot
2ea3adebc2 Merge "skins: Remove deprecated SkinCopyrightFooter $forContent param" 2019-11-19 21:17:56 +00:00
jenkins-bot
8d240f87a9 Merge "docs: Update hook documentation for PageContentSaveComplete" 2019-11-19 01:45:24 +00:00
jenkins-bot
cad9111aec Merge "hooks: Do not document the Parser object to be passed by ref" 2019-11-18 22:04:41 +00:00
Piotr Miazga
076993c938 skins: Remove deprecated SkinCopyrightFooter $forContent param
The $forContent parameter was deprecated six years ago and looks
like nothing else is using it (verified via codeseach.wmflabs.org)

Change-Id: I7c6093a083845a40b82e39c91006a5a0b223eab6
2019-11-18 16:16:27 -05:00
Thiemo Kreuz
17363ad381 hooks: Do not document the Parser object to be passed by ref
It does not make sense for hook handler functions to *expect* the
Parser to be passed by reference. Hook handlers not only can't do
anything with it being a reference, they should *not* use it to
replace the Parser with another one.

This is an obsolete relict from PHP 3 (?), where objects got passed as a
cloned copy, which was very expensive.

Note we can not update the Hooks::run() calls as long as a single
hook handler still *expects* a reference.

Bug: T193950
Change-Id: I5f9a3f56faec0e90a2839c064844928c3b5c9751
2019-11-18 16:47:08 +00:00
Thiemo Kreuz
210483fc16 hooks: Stop suggesting to pass objects by reference
It looks like the examples section on top of the hooks.txt file still
suggests to pass objects by reference. This is an obsolete relict from
PHP 4 and not needed any more.

Bug: T193950
Change-Id: I61bdc4a313401955943903918ff8167c2bea5aac
2019-11-18 16:45:28 +00:00
jenkins-bot
8aafbfc02f Merge "docs: Update ParserGetVariableValueSwitch documentation" 2019-11-15 04:29:59 +00:00
Umherirrender
1feb04b741 docs: Update hook documentation for PageContentSaveComplete
The hook no longer takes null, as of 4860e1d5ac (I492514413ec9c37c2f9343bb207798fc8e24a5a9).

Change-Id: I31b7768ae5bd2389b59f2aca1c55ca962a75b509
2019-11-12 18:45:21 +00:00
Thiemo Kreuz
abf62c6c78 Fix ApiQuerySiteinfo class name capitalization
Change-Id: I7e522fb34119b62c4fb59590f7ee8a45f5a4954d
2019-11-08 16:58:11 +01:00
jenkins-bot
baf3d4b803 Merge "Remove the deprecated GetBlockedStatus hook" 2019-10-21 17:11:27 +00:00
Thalia
3be681e625 Remove the deprecated GetBlockedStatus hook
Change-Id: I19d522ce32f540cc39bf482ab76f71492e4e9fd0
2019-10-21 17:16:20 +01:00
Thalia
e915f9538a Document that the GetUserBlock hook may pass null instead of a block
Change-Id: I776362564b8caff3c4ab0eb38eb5ef63034e0f51
2019-10-21 12:58:42 +01:00
Daimona Eaytoy
ad93e7ca09 Fix docs for GetUserBlock hooks
Change-Id: I93b64fb00477c0632a6fa3573800dd7609d25db0
2019-10-20 10:45:27 +02:00
jdlrobson
2bb8515286 Make Special:Contributions use OOUI
Changes:
* IP address/username is now a single label & input element combination
* Add page-specific styles in separate LESS file
* Remove no longer necessary CSS rule

Bug: T117736
Bug: T219238
Change-Id: I979078d8937898acae22bc28d5ed51da1d4ed627
2019-09-23 18:50:44 +00:00
James D. Forrester
7a15f45476 Follow-up 7960d53: Mark when the SecondaryDataUpdates and WikiPageDeletionUpdates hooks were deprecated
Change-Id: Id35cc5e1d21a62d0d6469b80b693bb654215db2a
2019-09-13 11:39:32 -07:00
Thiemo Kreuz
946f35705b docs: Update ParserGetVariableValueSwitch documentation
It never makes sense to pass a (possibly different) Parser or PPFrame
object *back* as a reference. The & are a relic from very old PHP
versions that cloned all objects before passing them. This is not
needed any more.

Change-Id: I9fdb184cb41a61842819d44c9f07bd9cf435bb14
2019-09-10 10:42:34 +02:00
Thalia
bf5464614b Deprecate the GetBlockedStatus hook
This was replaced by GetUserBlock in 7a5508573a.

Handlers in production were updated to use GetUserBlock in
I952aa7d40 and Ibbcd3a239.

Bug: T229035
Change-Id: I95f9fabc6e795243cfe0a1e8737ca6abfb865538
2019-09-09 23:29:25 +01:00
Thalia
af24fc1a7a Deprecate the UserIsHidden hook
This was replaced by GetUserBlock in 7a5508573a.

Handlers in production were updated to use GetUserBlock in
Ibbcd3a239.

Bug: T228948
Change-Id: I3e6da73e595e2bd6a96600fe2a6dc68a54d06a2e
2019-09-09 20:31:02 +01:00
Jack Phoenix
495f9fa290 resourceloader: Add $conf parameter to the 'ResourceLoaderGetConfigVars' hook
Change-Id: I3cca8ce87b303ef7dfd96bfe1fdda0c51c441f6f
2019-09-07 15:30:40 +00:00
Huji Lee
0a611b47a8 Skin: Add new hook, UndeletePageToolLinks, for Special:Undelete views
This allows extensions to add further links; the particular use case
in mind is for the AbuseFilter extension, but others may want this
too.

Bug: T231055
Change-Id: I671a0479e877e6c37606b688064cb9c893717709
2019-08-23 20:51:21 +00:00
Thalia
7a5508573a Ensure block hooks keep user state consistent with realistic blocks
Several block-related hooks allow the user to be put into in a state
that is inconsistent with blocks that can actually be made:
* With UserIsHidden, User::mHideName can be set to true without there
  being a block
* With UserIsBlockedFrom, a user can be blocked from editing a page
  without there being a block
* With GetBlockedStatus, public block properties can be arbitrarily
  set on a user

These problems are mostly theoretical, but mean that it is impossible to
make some basic assumptions, e.g. that a user who is blocked from a page
must have a block. The hooks are not widely used, and with a few changes
we can make them more robust so such assumptions can be made.

This patch:
* Ensures UserIsBlockedFrom is only called if there is a block. This
  would be a breaking change if any extensions were using this to block
  an unblocked user; the intended use case is clearly for extensions to
  allow user talk page access to blocked users.
* Adds a new hook, GetUserBlockComplete, which passes the block for
  modification. This should be used instead GetBlockedStatus and
  UserIsHidden, which will be deprecated in the future.
* Allows the 'hideName' option to be passed into the AbstractBlock
  constructor so that suppressing system blocks can be made.

Bug: T228948
Bug: T229035
Change-Id: I6f145335abeb16775b08e8c7c751a01f113281e3
2019-08-21 17:38:52 +01:00
jenkins-bot
0f80b077fc Merge "Add instrumentation to Special:Mute" 2019-08-20 17:34:29 +00:00
DannyS712
b01fbfeb40 hooks.txt: Convert docs to modern extension registration style
This changes the examples in hooks.txt from using the old format of
manually entering additions into `wgHooks` to instead use the new
`"Hooks“: {}` object format.

Bug: T230397
Change-Id: I48a9986e4243eb933088d36b4bb095b345ab62fd
2019-08-20 13:56:40 +00:00
Dayllan Maza
db4aaa1a3e Add instrumentation to Special:Mute
We are already tracking pageviews and with following change we should be able
to answer the following questions:
* Of the users who land on this page, what percentage of users actually
  mute or unmute someone
* Of the users who mute a user, which option(s) did they check/uncheck in order
  to mute/unmute the user

EventLogging Schema: https://meta.wikimedia.org/wiki/Schema:SpecialMuteSubmit

Bug: T224958
Change-Id: I655dbd999fd5d3d8f792c4f53b7cc502fe05afd5
2019-08-19 15:18:11 +00:00
jenkins-bot
4001c3892c Merge "Add ISearchResultSet" 2019-07-22 22:11:09 +00:00
jenkins-bot
d1f681a77d Merge "ChangesList: Add $groups parameter to FetchChangesList hook" 2019-07-22 21:45:41 +00:00
jdlrobson
d7f8c45856 ChangesList: Add $groups parameter to FetchChangesList hook
This parameter is needed for consumers trying to return a $list object.

Bug: T228280
Change-Id: Ib68ff8fa782ac12479ef02247cdf78e405b64bad
2019-07-22 21:31:40 +00:00
David Causse
6af636fb03 Add ISearchResultSet
Bug: T228626
Change-Id: I3306bf6107c97dd58adf578fd965bd11a422627d
2019-07-22 18:27:39 +00:00
James D. Forrester
714797861b Drop the UploadVerification hook, deprecated in 1.28
Change-Id: Ic1917fc95223cbf97845c2702ddf98accf8ba9c2
2019-07-19 13:50:13 -07:00
Dayllan Maza
b5f384f943 Add support for extentions to change Special:Mute form
The hook (SpecialMuteModifyFormFields) is used to append
the option to mute/unmute notifications from a specified user.

Special:Mute handles posting and saving the fields, the only
requirement is that the field name is the same as the property
that wants to be modified.

Currently there are only two notifications "blacklists":
* `email-blacklist` is directly handled in this page 'cause it is part of core.
* `echo-notifications-blacklist` is part of Echo, so this change is required
  to support it. See I77b3ccfdce9b501e

Bug: T220163
Change-Id: I2b3eee0802cb086091f35ecce13ae77a8e7d518d
2019-07-18 15:21:00 +00:00
jenkins-bot
a76cc0bf39 Merge "Remove $purgeBlobs parameter from LocalisationCacheRecache hook" 2019-07-16 00:13:53 +00:00
Roan Kattouw
cac26b713c Remove $purgeBlobs parameter from LocalisationCacheRecache hook
No longer allow hook functions to prevent message blobs from being
purged. Pass in an always-true variable for backwards compatibility,
which is then ignored.

Change-Id: I27ac9599711f2f0df2514a3934270af0ce03da7f
2019-07-15 15:32:03 -07:00
James Montalvo
8e28a4b8b8 Add ImgAuthModifyHeaders hook to img_auth.php to modify headers
Change-Id: I3c6fd7b0c39d7fd52c484494233241093d152f88
2019-07-15 21:50:48 +00:00
James D. Forrester
f3dbb9ce93 Drop ChangePasswordForm hook, deprecated in 1.27
Change-Id: Ia9281596e0d620b360ccd6cb7392d9516b9240b8
2019-07-12 10:41:01 -07:00
RazeSoldier
b95a76ae9e Drop APIEditBeforeSave hook
Removed the source code and the test code.

Bug: T220656
Change-Id: I3674da6d9c33c08ec2f1774cb793b3a952480571
2019-07-02 02:58:47 +08:00
jenkins-bot
8f8374204e Merge "Add support for xml dump schema 0.11" 2019-06-28 04:23:58 +00:00
daniel
fdc3e9f952 Add support for xml dump schema 0.11
Bug: T174031
Change-Id: I2717019ea7efe36694bd2b2fba4dc2952a987cfc
2019-06-27 21:56:01 +00:00
David Causse
92c20832f1 Deprecate SearchResult::termMatches()
And start indicating that hooks relying on this data might become
unreliable as this data is only populated by SearchDatabase search
engines.

This information was only populated by SearchDatabase implementations
and due to bad initial design of SearchResult[Set] (now fixed) it forced
users of these classes to carry this information for the sole purpose of
highlighting.
Because SearchEngine can now own their SearchResult[Set] implementations
nothing that is engine specific should be exposed outside of these
specific implementations.
If there are some logic that still requires access to such list of terms
they should be made engine specific by guarding their code against
instanceof SqlSearchResult.

Change-Id: I38b82c5e4c35309ee447edc3ded60ca6a18b247a
Depends-On: I53fe37c65c7940f696c1e184125e01e592a976e4
2019-06-27 08:44:06 -07:00
James D. Forrester
06a34d5895 Drop the UserLoadFromSession hook, deprecated in 1.27
Change-Id: Ic86d9ee1fe6763270e79e31296ecd027e5d41be2
2019-06-24 14:12:33 -07:00
James D. Forrester
614f15682c Drop the UserRights hook, deprecated in 1.26
Change-Id: Ib4dc6f495c0d1d2aa1f41c1f61e09437f33c9077
2019-06-24 11:11:17 -07:00
Umherirrender
9421f6f52f Fix param type of search terms in search related classes
Change-Id: I036434268f1e7992f7f9f23d2c1c0fcd399823c8
2019-06-14 19:50:12 +02:00