Commit graph

81 commits

Author SHA1 Message Date
libraryupgrader 5fc41bb340 build: Updating mediawiki/mediawiki-codesniffer to 32.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.ObjectTypeHintParam
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.MissingVar
* MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage

Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).
* Added the `wikimedia/mediawiki` profile in .eslintrc.json (T262222).

Change-Id: I73a5f722738dff75c623cf631bfa7e3dcf8d6f82
2020-10-29 13:34:25 +00:00
zoranzoki21 a66f0f7baa Fix MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
In ApiQueryGadgetCategories.php for function getList() I've added inline comment for ignoring this rule, because is unclear why it throws this error.

Change-Id: I74c4a6c75f48b8f7a237396666db3b37993c300d
2020-10-12 15:26:23 +00:00
zoranzoki21 bc5b58d736 Fix MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
Change-Id: I26209fd4fd44917733e2b34e34dea31ec0d95341
2020-10-12 11:10:15 +02:00
Ammar Abdulhamid 146545919d Remove usage of Skin::getSkinNames()
Bug: T257993
Change-Id: Icc945ce1e3287a3b25152702818e5b2a90232677
2020-08-26 07:54:17 +01:00
DannyS712 f5ecc23c17 Update hooks to use PageSaveComplete hook in MW 1.35+
Bug: T250566
Change-Id: Ieccc1cae8c4b53a582391066a1a6336eae6c9277
2020-06-25 22:50:05 +00:00
Reedy 3ce0a0fb38 Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: I17a7f0195dd0a419ae8afe46521dd8f061ba53c6
2020-05-20 00:13:16 +00:00
DannyS712 3f00fbb5aa Remove use of Revision::newFromTitle
Bug: T249183
Change-Id: Ibfcb8d7e56f559f3fb5179bac4dfeade8da22533
2020-04-08 12:44:29 +00:00
libraryupgrader 2abdd0f983 build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Additional changes:
* Added .eslintcache to .gitignore.

Add an explicit check before using the parameter.

Depends-On: I92ecaa9c14e5c8ba32d152a9e2246a2144b1c7da
Change-Id: I255237574e76f1c0d92f376bc8cbb81f7cb4ed14
2019-12-21 14:01:00 +01:00
Umherirrender 7c13328467 build: Updating mediawiki/mediawiki-phan-config to 0.8.0
Argument 1 ($min) is 7000000.0 but \mt_rand() takes int
Argument 2 ($max) is 15000000.0 but \mt_rand() takes int

Bug: T235049
Change-Id: I2d7d0d6defd312dbed0de833678f3768fa3d7a46
2019-11-03 12:13:20 +01:00
Umherirrender db80002484 phan: Remove suppression for PhanParamTooMany
Depends-On: Id66af5c3de3e5bc5c2909316e1984eae95a0012a
Change-Id: I49daa6ec7d58d2e5b9882025f5c68552c6537567
2019-10-04 11:46:21 +02:00
Derk-Jan Hartman 2008def806 Only queue gadget module if relevant on the current target
Bug: T171180
Depends-On: Ibe693bb6a84bdf56fd22d1ea1f0b798094b91c62
Change-Id: Ibce4d642c87651880f3c981dfa0d68def3bddd3a
2019-10-02 19:43:15 +00:00
jenkins-bot 9d4d4b0a67 Merge "Hook handlers don't always need to return something" 2019-07-26 15:09:44 +00:00
Max Semenik 2470a59218 Hook handlers don't always need to return something
And other minor fixes to hook signatures.

Change-Id: Ib6d8c9dff5bb79386ac88828ba2a57a9bf81ee71
2019-07-23 02:23:27 -07:00
DannyS712 bbdc32d8d6 Add help links to special pages
Bug: T228071
Change-Id: I1bfa452ed21db5f6edc8971390b407e57e7e015d
2019-07-18 01:35:23 +00:00
jenkins-bot 1564077b1f Merge "Preload tablesorter styles by module 'jquery.tablesorter.styles'" 2019-06-11 20:19:19 +00:00
Thiemo Kreuz 62f3d828b8 Update some generic/unspecific PHPDoc type hints
Change-Id: I30ad46cc9d503b4403dd2e0ab263d0db2039a8e3
2019-06-04 17:33:17 +02:00
Kunal Mehta b28ad14b8c Upgrade to newer phan
Bug: T216919
Change-Id: I3a403891eafa703215a79526fcf9469b1fd6edc6
2019-03-17 16:39:02 -07:00
Max Semenik 963f3c1525 Don't use deprecated Sanitizer::escapeId()
Change-Id: Ia92e685d33e377669b034b02819e183efe77e4f2
2019-02-22 12:26:17 -08:00
Fomafix ef2197f713 Preload tablesorter styles by module 'jquery.tablesorter.styles'
This change avoids the flash of missing sorting buttons while loading,
but only with I0b446d18f47428d8c0c4aed78b75de16fe106218 in MediaWiki
core included in MediaWiki 1.33 or higher.

Depends-On: I0b446d18f47428d8c0c4aed78b75de16fe106218
Change-Id: I6efb7a995589a7b93691d5ebd37ae8ac42f0a971
2019-02-02 17:10:32 +01:00
Fomafix be4e6db51d SpecialGadgetUsage: Add Infinity as sort-value for defaults
This change ensures that gadgets that are enabled by default are sorted
with a higher value than the other gadgets.

Change-Id: I02fab73c85b4c3580e484832c91a7314c797e978
2019-01-22 04:58:39 +00:00
Fomafix 49ec533e8d Fix typo in comment
This typo was introduced in 88d0b223.

Change-Id: Ib9adde89ccc1fca6bac0ceb5ba409637a03f7dd7
2019-01-04 23:11:51 +01:00
Umherirrender 6b2e46b142 Declare visibility on SpecialGadgetUsage::__construct
Change-Id: Id98c214770224e6d5b65e1c164a6663e09861a0f
2018-10-31 23:18:47 +01:00
Aaron Schulz 1204d238f0 Increase loadGadgets() expiry to 15 seconds to avoid stampedes
Bug: T203786
Change-Id: If45b91987f3f523139e5e66f546be17a455647fe
2018-10-30 15:55:51 +00:00
Aaron Schulz 1acde38a6a Randomized APC gadget definition refreshes to avoid stampedes to memcached
Bug: T203786
Change-Id: If87e752f5cdc6bd216ad96486a86a40b2477b315
2018-10-19 01:57:07 +00:00
Aaron Schulz 93137ec581 Clean up gadget definition key code
Change-Id: Ic3116de9f5b76375c908f540a29945203f14d4c5
2018-10-05 03:29:29 -07:00
Umherirrender c8b50c30ee Fix caller name in GadgetDefinitionNamespaceRepo::getGadgetIds
Seeing {closure} in the logs as caller is not helpful

Change-Id: I1bfefd86aa0929ddafff3ccbdf50730a22fcdcb4
2018-09-30 13:47:56 +02:00
Timo Tijhof 848775d925 SpecialGadgets: Restore line breaks between actions and uses
Follows-up f3da602. I accidentally removed the first of the
line breaks.

Bug: T204616
Change-Id: I53b43acb5c0d43443b2f62bd335fc013d2e23539
2018-09-26 03:46:10 +01:00
Timo Tijhof f3da602058 SpecialGadgets: Omit blank space due to <br> between <ul> and <p>
Due to some of the portions of the gadget list items being optional
it's not consistent whether or not they should be separated by
a line break.

When two pieces of text follow each other, there should be a line
break in-between.

When a piece of text is output afte a list, however, there is no
need for a line break as anything after a list would already
become its own line. Printing one anyway causes a blank space
to show up, which visually causes it to appear related to the
next gadget.

Fix by setting a boolean after each portion to indicate whether
or not it should be followed by a line break.

Also improve the code a bit with comments and use Html instead
of Xml.

Bug: T204616
Change-Id: If65e170746898999dd8f5351004eeaf49b340ab2
2018-09-17 23:33:35 +01:00
Timo Tijhof e369419bdd SpecialGadgets: List right names instead of descriptions
The lengthy and localised descriptions make it hard to scan and
identify the actual rights themselves. They are meant as descriptions
to explain what a right is, not to identify the right itself.

It should probably be more similar to the list of checkboxes
on Special:UserRights. For now, kept the descriptions as tooltips,
but could also remove them entirely.

Change-Id: I29f68ffd5a8d002b65384f3762fb9e5631c13def
2018-09-17 23:17:44 +01:00
Bartosz Dziewoński 52d57c6597 Avoid 'rawrow' for HTMLForm 'info' fields
The wrapper tags that we have to create when using the 'rawrow' option
would have to be different for OOUI and non-OOUI preferences forms,
making it impossible to support both at the same time.

We used it in order to generate `<td colspan=2>...</td>` rather than
`<td></td><td>...</td>`, and make the description span both the label
and the input columns. However, this is not necessary, because the
label column is entirely hidden on this page of preferences, as all of
the preferences have no labels.

Bug: T203202
Change-Id: Ib9510a8bfb2430fdda3988d88628c9f0c509c6d0
2018-09-03 18:19:34 +02:00
Thiemo Kreuz 01a3de04e7 Remove not needed properties from "info" form field
* "raw" and "rawrow" are documented as booleans.
* "raw" does not have any effect if "rawrow" is set.
* "label" does not have any effect if "rawrow" is set.
* "noglobal" refers to GlobalPreferences. It does not have any effect
  because "info" fields are blacklisted anyway.

https://github.com/wikimedia/mediawiki-extensions-GlobalPreferences/blob/master/includes/GlobalPreferencesFactory.php#L75

Also see my longer comment in I1ab2bc6 where I explain all these changes.

Change-Id: I7b4e08b45070ae07935e1cd59091b3d608583e5b
2018-08-20 14:41:35 +00:00
jenkins-bot a6c181e610 Merge "SpecialGadgetUsage: Add <thead> and <tbody> in the table" 2018-08-15 05:00:22 +00:00
jenkins-bot 7fddd2bdc7 Merge "Use ContentLanguage service instead of global $wgContLang" 2018-08-12 04:56:26 +00:00
Derk-Jan Hartman 9e24c3a551 RL: Simplify userrights check of Gadgets
Change-Id: I135dcfdba72014803b8ce9710680fb5574f76d04
2018-08-08 13:46:24 +00:00
Fomafix b6e7bcf015 Use ContentLanguage service instead of global $wgContLang
This change raises MediaWiki version requirement to 1.32.

Change-Id: Ieffed829bf5a8e1f138fd5f63518e415cebb1287
Depends-On: I193f5b9a95430b0a05573c361715e053e5411e32
2018-08-05 00:52:53 +02:00
jenkins-bot ef4c537d9e Merge "Fix skins option to use currently displayed skin, rather than user preference" 2018-08-03 18:53:39 +00:00
Matt Russell b340532c52 Fix skins option to use currently displayed skin, rather than user preference
The user's preference usually reflects the displayed skin, however this isn't
true if the `useskin` URL query is set, or MobileFrontend is being used.

This fixes gadgets being displayed on the wrong skin when using `useskin`,
and allows mobile-specific gadgets (using `skins=minerva`).

Testing if the gadget is allowed in the current skin is split out from
`isAllowed` to `isSkinSupported` to enable a future patch showing gadgets
on preferences regardless of if they are allowed on the current skin.
Test coverage is added for both functions.

Also fixed another test which wasn't working, presumably because the placeholder
user didn't have the "read" right, so the section wasn't being kept.

Bug: T199478
Change-Id: I21febe92d54d6d0b89925f902581cc2739d824fb
2018-08-01 11:06:17 +10:00
Fomafix 3aeffaa12b SpecialGadgetUsage: Add <thead> and <tbody> in the table
Change-Id: I53f61ce4c7d0721171a455e25b560ce33d4109b9
2018-07-30 21:38:20 +02:00
Fomafix 98ac345756 Use $lang->equals() to compare Language objects
Change-Id: Iae691c2b1e4f34bb0f509a109333277ade900659
2018-07-30 20:01:18 +02:00
libraryupgrader 33ecce01c0 build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
Change-Id: I210883a100f2060e9bff0d5066896ce35b45a788
2018-05-26 03:01:39 +00:00
Kunal Mehta c383794d16 Fix variable name reuse in EditFilterMergedContent hook
Bug: T194695
Change-Id: Ic99e35874f1a3a4a7c1d1c302294bbecd23080ed
2018-05-14 17:11:58 -07:00
Jayprakash12345 54d1eb0d77 Convert Special:Gadgets/export/$par to use OOUI
Bug: T191822
Change-Id: Ia59918a1a7f10d56a5c32050591a537d90c6de7c
2018-04-09 23:20:17 +05:30
jenkins-bot 435d0f4fcd Merge "Use SPDX license identifiers for @license" 2018-04-07 21:06:34 +00:00
jenkins-bot 4ca18e2fac Merge "Change ResultWrapper to IResultWrapper in special page" 2018-04-07 21:06:33 +00:00
Kunal Mehta bb81950e9f Use SPDX license identifiers for @license
Change-Id: I7eaf1d7bd11642f40a59505c1586fb393bf35283
2018-04-07 08:42:12 +00:00
Umherirrender 75ce384e42 Change ResultWrapper to IResultWrapper in special page
Follows core change I22ec4d3a9a19fc86efc9a2deb06f810695d38c85

Change-Id: I3f5e63478761e2cf312f75771b152d01111a3fa6
2018-04-07 10:35:58 +02:00
Sam Wilson 97c5bd7732 Prevent gadget preferences from being cleaned up
Bug: T188966
Change-Id: I5627f014827fdbf266eb7fdb00a446f81a0c3458
2018-04-06 20:06:11 +00:00
Kunal Mehta e99e181303 Add phan configuration
Depends-On: I09a0c0a786b687997e61344847f8af08b20cebf2
Change-Id: I9500232fb524e884d6cb15f2bdda10835df35ad4
2018-02-26 12:57:40 -08:00
Kunal Mehta 677d4e932c Move classes into includes/
Change-Id: I10bc5234ad2ebeed2514aafc3dbe2a0afa983bd8
2018-02-25 11:19:23 +00:00
Thiemo Mättig f564d52d9a Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates
DataUpdate is a specific implementation (currently the only one), while
DeferrableUpdate is the interface. Binding against the interface is
enough, and what the base classes already do.

I'm also removing a line of meaningless documentation. "Creates an
instance of this class" is a general description that is true for all
constructors.

Change-Id: Ia6dc86b078628db5e0ab68ef46bf0396567b767c
2018-01-24 14:51:16 +01:00