Commit graph

1649 commits

Author SHA1 Message Date
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
Timo Tijhof
34bff221ba mediawiki.messagePoster: Introduce 'MessagePosterModule' extension attribute
This allows extensions to add additional files or dependencies to
the 'mediawiki.messagePoster' module bundle.

Bug: T235315
Change-Id: I17c34cbb26e786328d3d99beb0c0fa65e15ea084
2019-10-17 18:00:10 +00:00
jdlrobson
e97f2943f2 registration: QUnitTestModule should support packageFiles and templates
Change-Id: I1a66939d2b596094b419de40b370e79f09c85581
2019-10-04 17:09:39 +00:00
apaskulin
5443e647bf docs: Fix typo on Doxygen main page
This PR fixes a typo and removes a few extra words
from the Doxygen landing page.

Change-Id: Ieb09c0e72129f4c6b0ccd574daf2f9316f580259
2019-09-27 07:45:59 -07: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
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
mainframe98
b7b490e46d Support the creation of special pages with services injected
Now that the ObjectFactory library supports object creation with
services (T222409), the special page factory can use the object
factory to create special pages based off a spec, allowing the
creation of special pages that need services injected.

The object factory now also handles constructing from class name
and from callable.

This also deprecates providing the special page list with an
instance of SpecialPage, which hasn't been necessary since
r15031.

Bug: T222388
Change-Id: Iabb78ce5c98cfb3b586644be35d984871cb750cb
2019-09-08 12:57:54 +02:00
Jack Phoenix
495f9fa290 resourceloader: Add $conf parameter to the 'ResourceLoaderGetConfigVars' hook
Change-Id: I3cca8ce87b303ef7dfd96bfe1fdda0c51c441f6f
2019-09-07 15:30:40 +00:00
Timo Tijhof
b7c5acd419 docs: Convert doxygen_first_page.php to proper Markdown
Doxygen has native support for indexing of Markdown pages.
It basically parses them the same way it parses the uglier
methodology of creating a PHP file containing a the markdown
text in a large comment that would start with `@page` or `@mainpage`.

* http://doxygen.nl/manual/commands.html#cmdpage
* http://doxygen.nl/manual/commands.html#cmdmainpage
* http://doxygen.nl/manual/markdown.html#md_page_header

The internal reference name and page title (comparable to the string
passed to `@mainpage` or `@page`) are by default derived from the
file name (without suffix).

The internal reference name (for use in cross-page links) can also
be overidden with an `{#something}` annotation in the first heading.

When using the annotation `{#mainpage}` it changes the page type
from a regular `@page` to the `@mainpage`.

Change-Id: I0c25a49088825744773c4d87dde5688894b2004e
2019-09-04 22:57:02 +00:00
Timo Tijhof
178d312eb8 MessageCache: Remove $wgMsgCacheExpiry configuration var
This variable has never been set to anything other than the default value of
24 hours as introduced in 2003 (r2203, r2204; or 036ff960ce, edf6b38626).

The variable has never changed in core, it's not overridden at WMF,
and MessageCache is not constructed anywhere other than ServiceWiring.php
anywhere in repos on Wikimedia Gerrit, indexed by MediaWiki Codesearch,
or any GitHub-hosted repository (incl Wikia repos and WikiHow mirrors).

I've also checked all GitHub-hosted repos for boilerplates and/or public
settings files from devs or prod, and couldn't find any example of
this being overridden (after filtering out copies of the core files
themselves). Rather than having to support potentially hard-to-predict
interactions betweeen caching layers by checking its state, make it
a constant so we can code reason about it more easily.

Change-Id: Ie2e139001aae3ac54b509d94a3d917bb408eaca0
2019-08-27 17:33:11 +00:00
Daimona Eaytoy
f18af0b61f Remove more Oracle and Mssql leftovers
Follows-up 4d10bb14e8 and 807d793ab9.

According to codesearch [0], these were the last usages. Note that this
patch leaves two constants in places, IDatabase::DBO_SYSDBA and
DBO_DDLMODE. These are public constants used "mostly for oracle" according
to the docs, but maybe we could find other use cases in the future (?).

[0] - https://codesearch.wmflabs.org/core/?q=oracle%7Cmssql&i=fosho&files=%5C.%5B%5Ej%5Cd%5D%7Cen%5C.json&repos=

Bug: T230418
Change-Id: Ibfb748b4b23b885a77f4de161af4bf2ab9649a89
2019-08-25 17:21:49 +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
jenkins-bot
cc28c4a04c Merge "hooks.txt: Convert docs to modern extension registration style" 2019-08-20 15:13:41 +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
DannyS712
a4835b43c7 docs: Fix typos for 'parameter' and 'perform'
Bug: T201491
Change-Id: I37ed48907bf7c1a1d4ebab7b10b41a77623eba8a
2019-08-20 09:45:52 +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
jenkins-bot
e55888be36 Merge "Allow skins/extensions to define custom OOUI themes" 2019-07-15 20:21:01 +00:00
James D. Forrester
f3dbb9ce93 Drop ChangePasswordForm hook, deprecated in 1.27
Change-Id: Ia9281596e0d620b360ccd6cb7392d9516b9240b8
2019-07-12 10:41:01 -07:00
Tim Starling
dda7a2c3ed Some fixes to page updater docs
A couple of typos, and also remove a thing that says isDeleted() should
be skipped for the current revision -- isDeleted() does not do a DB
query so there's no performance rationale for spreading assumptions and
increasing complexity in that way.

Change-Id: I661a6889618f188a9aa72f2f9a2c2ebf69ba09c4
2019-07-11 15:59:56 +10:00
Bartosz Dziewoński
77f4bab8b7 Allow skins/extensions to define custom OOUI themes
This change follows I39cc2a735d9625c87bf4ede6f5fb0ec441d47dcc.

docs/extension.schema.v1.json
docs/extension.schema.v2.json
includes/registration/ExtensionProcessor.php
* The new extension attribute 'OOUIThemePaths' can be used to define
  custom OOUI themes. See I9187a63e509b601b8558ea82850fa828e5c8cc0a
  for an example usage.

includes/resourceloader/ResourceLoaderOOUIModule.php
* Add support for 'OOUIThemePaths'.
* Defining 'images' is now optional. I figure custom themes are
  unlikely to have or need them.
* Use ResourceLoaderFilePath objects to allow skin-/extension-defined
  OOUI module files to use skin/extension's base paths.
  This was previously used to support $wgResourceModuleSkinStyles,
  but only for 'skinStyles' - now ResourceLoaderFileModule needs
  to also handle it for 'skinScripts', and ResourceLoaderImageModule
  for 'images').

includes/resourceloader/ResourceLoaderFilePath.php
* Add getters for local/remote base paths, for when we need to
  construct a new ResourceLoaderFilePath based on existing one.

includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderOOUIImageModule.php
* Add or improve handling of ResourceLoaderFilePaths:
  * Replace `(array)` casts with explicit array wrapping, to avoid
    casting objects into associative arrays.
  * Use getLocalPath() instead of string concatenation.

tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php
* Some basic checks for the above.

Bug: T100896
Change-Id: I74362f0fc215b26f1f104ce7bdbbac1e106736ad
2019-07-10 22:08:14 +02: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
Fomafix
110a5877e9 Use [...] instead of array(...) in PHP comments and documentation
Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2
2019-06-17 21:15:09 +02:00
jenkins-bot
8ffabe23a1 Merge "Fix param type of search terms in search related classes" 2019-06-17 07:54:27 +00:00
Umherirrender
9421f6f52f Fix param type of search terms in search related classes
Change-Id: I036434268f1e7992f7f9f23d2c1c0fcd399823c8
2019-06-14 19:50:12 +02:00
jenkins-bot
7c966af21a Merge "REST API initial commit" 2019-06-13 22:18:21 +00:00
Tim Starling
3f0056a252 REST API initial commit
Add some of the basic REST API class hierarchies:

* EntryPoint
* Router
* Request
* Response
* Handler

The actual entry point file rest.php has been moved to a separate
commit, so this is just an unused library and service.

Bug: T221177
Change-Id: Ifca6bcb8a304e8e8b7f52b79c607bdcebf805cd1
2019-06-12 10:22:28 +10:00
jenkins-bot
6e30404bae Merge "registration: Deprecate ParserTestFiles in extension.json" 2019-06-09 20:13:23 +00:00
Umherirrender
8a14f73a64 Document $rows on hook ChangesListInitRows as IResultWrapper
Change-Id: I243b460c4788a2bee095cb76b76106577f06b96f
2019-06-03 21:35:51 +02:00
Kunal Mehta
286a2a1852 registration: Deprecate ParserTestFiles in extension.json
Warnings will be emitted whenever validation is checked or unit tests are
run.

Bug: T192154
Change-Id: Ib968f696890667841d850ef5562e05989cb4f431
2019-06-02 21:53:31 -04:00