Commit graph

1823 commits

Author SHA1 Message Date
DannyS712
df6c612941 ExtensionProcessor: Remove loaderScripts from extension.json schemas
The `loaderScripts` feature of ResourceLoaderFileModule was removed
without replacement a while ago. Use of it would no longer work
correctly and should result in a test failure.

The `position` property was also removed, but made no functional change
to behaviour. Update its documentation to clarify that it is no longer
used (it is simply no longer needed).

Bug: T289108
Change-Id: If3dbbbe95d60803be8df3c9a4d5ee9e01c825ebb
2021-08-20 04:11:53 +00:00
Fomafix
356f1b72ef Use IEC prefixes instead of SI prefixes for byte sizes (docs+backend)
This change doesn't change any UI messages.

Bug: T54687
Change-Id: Ia62899a2a6fe8910618c35cd667291e397ddb055
2021-06-28 11:59:09 +01:00
DannyS712
47d70dbfba Post Revision-removal cleanup
Updates for the removal of the Revision class itself
and the various methods/hooks/variables removed in the
process, including:

- Update some documentation removing most references
to the Revision class and updating the MCR migration
notes to reflect the past tense for Revision methods.

- Change some capitalization from "Revision" to "revision"
to make it clear comments are about revisions in general,
not the Revision class in particular.

- Minor code tweaks including removing unused variables that
were around for the old hooks that were removed, and
removing the use of DeprecatablePropertyArray where no
longer needed for anything.

- Fix incorrect documentation for PageUpdater::getStatus(),
the status value changed a while ago to have revision-record
in addition to revision, and recently to only have the
revision-record, but ironically PageUpdater was never updated.

- Removed Parser::$mRevisionObject, used to be a Revision object
and was deprecated in 1.35, missed earlier because it was no
longer being set to Revision objects, always null.

- Add RevisionRecord typehints in DummyLinker to match those
in the corresponding Linker methods

This should be a no-op in terms of functionality.

Bug: T247143
Change-Id: I03bbb94fc29085855448780b1a5ad9063911ecc4
2021-06-24 00:32:39 +00:00
jenkins-bot
7837931be9 Merge "Add missing *Path properties to OOUIThemePaths" 2021-06-21 13:00:11 +00:00
Amir Sarabadani
d37ad656c2 Make postgres IRC channel point to libera.chat
They have migrated to libera.chat:
https://www.postgresql.org/community/irc/

Bug: T283273
Change-Id: I5f14e9079cdac628fa81e6d237f9a5906bf46b6f
2021-05-26 23:35:42 +02:00
MacFan4000
c351c4f06e Freenode -> Libera per wikimedia moving from freenode to libera
Bug: T283247
Change-Id: Iebbb13ac53830a8d77b42bf2954cf80d76d78467
2021-05-20 22:10:24 +00:00
James D. Forrester
f2f9345e39 Replace uses of DB_MASTER with DB_PRIMARY in documentation and local variables
This is just a start.

Bug: T254646
Change-Id: I9213aad4660e27afe7ff9e5d2e730cbf03911068
2021-05-14 12:40:34 -07:00
jenkins-bot
f1fe87e2b0 Merge "Add extension.json merge strategy "provide_default"" 2021-05-13 23:20:47 +00:00
jenkins-bot
32d1ce99a7 Merge "registration: Allow multi-line strings in "@" note keys" 2021-05-08 05:13:42 +00:00
Tim Starling
076b93fba0 Add extension.json merge strategy "provide_default"
Add a merge strategy which sets the whole value only if the global
has not previously been set. This can be used to allow LocalSettings.php
to remove elements from an array created by extension.json.

Bug: T142663
Change-Id: Id250f9c349ee4eafbc759452ca6ea2a918baeb11
2021-05-04 16:02:55 +10:00
DannyS712
7bd7d2a6c1 Remove hooks that use Revision objects
All hooks were previously hard deprecated
in 1.35. Affected hooks:
* ArticleRevisionUndeleted - use RevisionUndeleted
* ArticleRollbackComplete - use RollbackComplete
* DiffRevisionTools - use DiffTools
* DiffViewHeader - use DifferenceEngineViewHeader
* HistoryRevisionTools - use HistoryTools
* NewRevisionFromEditComplete - use RevisionFromEditComplete
* PageContentInsertComplete - use PageSaveComplete
* PageContentSaveComplete - use PageSaveComplete
* ParserFetchTemplate - use BeforeParserFetchTemplateRevisionRecord
* RevisionInsertComplete - use RevisionRecordInserted
* TitleMoveComplete - use PageMoveComplete
* TitleMoveCompleting - use PageMoveCompleting
* UndeleteShowRevision - no replacement

Includes a fix for setting the associated rev id
of page protections, which previously was only done
using $nullRevision which was a Revision object created
if any hooks needed it; those hooks were hard deprecated
and so for WMF prod the rev id was not being set.

Bug: T247143
Depends-On: Idfa345193ae99fb2f1c9a8f8d28d8d540a6e3d62
Change-Id: I519167f76a5a3c1f5410415b2721462a3dcc3ec8
2021-04-30 17:28:20 +00:00
Timo Tijhof
39e2abd886 registration: Allow multi-line strings in "@" note keys
Change-Id: Ifb1a0f04cc22b122ed99308c096d0ce4296e9097
2021-04-29 02:47:47 +01:00
lens0021
c648468f1d
Add missing *Path properties to OOUIThemePaths
\ResourceLoaderOOUIFileModule extends \ResourceLoaderFileModule, so it
handles "localBasePath", "remoteExtPath" and "remoteSkinPath" properties
in code and works well as expected in reality.

But ExtensionJsonValidationTest fails because of the lack of the schema.
This fixes the false-negative failure.

Change-Id: I9d07a9b9984d934811478fef9cc2fe24cbbd3bc7
2021-04-19 18:30:16 +09:00
Ammarpad
0e7bf93d48 Drop two unused Perl scripts
Probably nobody is using these.

Also hopefully after fully migrating to abstract schema, there'd
not be any more unnecessary drifts between MySQL and Postgres tables,
obsoleting the need for compare_schema.pl

For mysql2postgres.pl, dumpBackup.php/importDump.php can be used.

Bug: T258876
Change-Id: Ief36bca6f3a387f811408f2a5e4840656dfffff2
2021-03-27 11:47:48 +01:00
Ammarpad
ba17c42a79 registry: Allow specifying immovable namespaces in extension.json
In most cases this will alleviate the need to use the
ImmovableNamespaces hook.

Bug: T277520
Change-Id: If1e1063a597ebdb39343a356cc381a6ceafaebcc
2021-03-17 06:10:35 +00:00
James D. Forrester
bdddfb92ba Drop wgContLang, deprecated in 1.32
Bug: T245940
Depends-On: Ib7fe7318100c0aadc3aa759416bf787913a9b788
Change-Id: I75c3b6715abd5eaf3619337cab8b1844e9a8349a
2021-03-08 13:27:28 -06:00
Roan Kattouw
b267f7aa90 resourceloader: Allow modules to mark themselves as ES6-only
Modules that set "es6": true in their module definition will error when
a non-ES6 client tries to load them.

To detect ES6 support, this looks for native Promise support,
RegExp.prototype.flags, and non-BMP characters in variable names. All
browsers that lack full ES6 support fail at least one of those checks.

To flag modules as requiring ES6, this adds a ! to the end of their
version string. This takes up much less space than adding another
register() parameter (which would have to be at the end). It's hacky,
but we expect this feature to be relatively temporary, until we require
ES6 for running any JS at all (probably in about a year).

For distinguishing different types of errors thrown from
sortDependencies(), use e.name. We can't subclass Error properly because
that requires ES6.

Bug: T272104
Change-Id: I45670c910ff12eb422ae54c9fcf372e45c7b2bf1
2021-03-04 14:53:36 -05:00
Ammarpad
bed437e131 Fix 404 link for Maintenance class doxygen doc
Change-Id: I15c0b55d1d0269e0f26887055e648de266291abf
2021-01-31 11:11:34 +01:00
jenkins-bot
5ebb7dd4d0 Merge "Add db group documentation" 2020-12-09 23:41:21 +00:00
Nikki Nikkhoui
3067ec77c2 Add db group documentation
Add section to database.md outlining simple
usage of database groups and the 3 remaining
supported types.

Bug: T267077
Change-Id: I66cb2fb063f291afc94ff207ef8d9a035bfc6a86
2020-12-09 23:10:48 +00:00
C. Scott Ananian
8510f728b1 docs: Fix JSON for deprecation in Hooks doc
A quoted string here will fail validation in ExtensionJsonValidationTest.

Change-Id: I8d8bbb03f4238090cab13218d45123e885744c9b
2020-12-09 15:03:49 -05:00
DannyS712
6a03737104 Update for object-factory v.3
Bug: T267074
Change-Id: Iff9b46c9e78e87d32c8f75d26b284ce01bccb63d
2020-11-17 06:20:23 +00:00
Tim Starling
9834d4c214 Prevent service injection to LoadExtensionSchemaUpdates hook
* Add noServices option to HookContainer::run()
* Use the option for LoadExtensionSchemaUpdates
* Document service injection including the caveats we know about

Bug: T258851
Change-Id: Ie57f2a3aeeea883f392e3c83ff228d1de68c6ebf
2020-09-18 08:01:52 +10:00
Timo Tijhof
0c01d8cc52 resourceloader: Add skin-based 'mediawiki.skin.variables.less' import
Add the SkinLessImportPaths attribute for skin-specific LESS import
paths, which skins can use to override the mediawiki.skin.variables.less
file.

As a starting point, add the following 5 variables:

* device widths (3x)
  To help phase out 'mediawiki.ui/variables'. These are
  commonly used by MobileFrontend.

* @font-family-sans
  Recommended by Volker. Used by multiple skins.

* @border-radius-base
  Recommended by Volker as example of something that we currently
  hardcode in MediaWiki core for Vector and OOUI/WikimediaUI
  in 'mediawiki.widgets.datetime' but should instead be allowed
  to vary by skin and OOUI theme.

  Remove the hardcoded value for '@border-radius-base' in
  various places in favour of importing from mediawiki.skin.
  The default is a bare default of 0 (as border-radius is off
  by default in the browser).

  The value for Vector is restored there by I47da304667811.
  The value for MonoBook is improved by I000f319ab31b.

Bug: T112747
Change-Id: Icf86c930a3b5524254bb549624737d3b9dccb032
2020-09-15 10:05:53 +00:00
Timo Tijhof
10bdad0d35 Remove $wgMemc
Deprecated since 1.35, and no longer used in core, bundled, or
wmf-deployed projects.

Bug: T160813
Change-Id: Idd3166ef90d1795a0b22dc29d52de76048d0703e
2020-07-27 23:45:22 +00:00
Kunal Mehta
46d4504660 registration: Sync v2 and v1 schemas
Unless it's an intentional deviation, everything in v2 should also be in v1.

This copies over:
* e71e025aba: Add 'ParsoidModules' ...
* 7abd828ea3: Extension schema updates for HookContainer
* 34bff221ba: Introduce 'MessagePosterModule' extension attribute
* e97f2943f2: QUnitTestModule should support packageFiles and templates
** d50c7f5b56: Fix schemas for 'packageFiles'
** ee1f4f8ea3: Fix schemas for 'templates'
* 3f0056a252: REST API initial commit

Change-Id: I1ae6fed0261ad29ea5cb39b3511b8cde392ab612
2020-07-20 16:31:45 -07:00
jenkins-bot
ba6a7bfacb Merge "Update the hooks documentation included with MediaWiki." 2020-07-16 21:59:32 +00:00
Kosta Harlan
3e52a04c99 Clarify hook definition in extension.json
Change-Id: I7bbdde9d476dc98b8e99fa38cd5d54903341bd21
2020-07-16 19:13:56 +02:00
Bill Pirkle
56660af3db Update the hooks documentation included with MediaWiki.
The docs/hooks.txt file described the hook system from MediaWiki
1.34 and earlier. Its continued presence was confusing to developers,
who were not sure if they should update it. Remove the majority of
this file and direct developers to Hooks.md, which describes the
hook system implemented in 1.35. Also add a link to
https://www.mediawiki.org/wiki/Manual:Hooks to both hooks.txt and
Hooks.md.

Bug: T257804
Change-Id: I5998f179acde1a7fb1053c23305f949fa63542d9
2020-07-16 09:02:05 -05:00
jenkins-bot
6c90c2758b Merge "registration: Restrict properties in "config" in manifest_version 2" 2020-07-14 09:40:15 +00:00
kalle
3177547540 registration: Fix string "true" in extension v2 schema
Extension tags required value was the string value "true",
but really should be the boolean value true.

Bug: T257898
Change-Id: I6372fc55b864e898268c6df3f7cdead03b37d53f
2020-07-14 08:50:03 +00:00
Umherirrender
ae7429f878 Adjust documentation of ContributionsLineEndingHook
It is called from the ContribsPager class with $this
The type is correct, but the comment is indicating a SpecialPage object

Change-Id: I83487c288e9f0325c198eaf307ca56f65ade7eee
2020-07-12 11:20:21 +02:00
Sam Wilson
4fa7d4d7a7 Add watchlist expiry to edit form
This adds new functionality to allow non-checkbox widgets to be
used in the checkboxes row of the edit form, and adds a dropdown
widget for the watchlist-expiry field.

Bug: T248494
Change-Id: Ice5113a97b1ef97253bfa6874ea71d910a5cd8fd
2020-06-30 10:22:04 +08:00
jdlrobson
5e9604f429 Deprecate SkinTemplateOutputPageBeforeExec hook
All Wikimedia production extensions are no longer using this hook. The
hook is very generic and very dangerous per ticket and I would like to
close up future usages while we still can.

Bug: T60137
Change-Id: I294a420763e4c5a06a6692339efd28614a17d3c0
2020-06-29 15:19:55 -07:00
Roan Kattouw
c8b9d849fc Add PageMoveCompleting hook, to replace TitleMoveCompleting
We intially thought we wouldn't need this and would only need
PageMoveComplete, but it turns out Flow does need it.

Bug: T250023
Bug: T255608
Change-Id: I8e7308541d2fe6d02b9dad63e1c86c89f6e7cf53
2020-06-16 22:27:28 -07:00
Ammar Abdulhamid
dec08eacdd Deprecate SkinTemplateToolboxEnd hook
Bug: T253783
Change-Id: Ia6f46c1e3d33a14d3f3161f1716f9d0791cd397d
2020-06-15 23:18:05 +00:00
Vas Jaremchuk
cea8cd4102 Add release-notes for two deprecated hooks
SkinTemplatePreventOtherActiveTabs and SkinTemplateTabAction hooks were
deprecated in I96af224e6a6389f5f78bbe051c45fa796cd60ec0.

This patch adds deprecation notes for them in release notes and hooks.txt

Bug: T253814
Change-Id: Ic9e04872e68e4522fbb32443044a6d5aeadbd82a
2020-06-15 13:57:48 +00:00
Ammar Abdulhamid
6ef284e37e Hard deprecate BaseTemplateToolbox hook
Superseded by SidebarBeforeOutput.

Note: Translate extension is using it to serve < 1.35

Bug: T253416
Change-Id: Ia038647df14727f45f01a0923277d4d084e372af
2020-06-13 10:03:49 +01:00
Ammar Abdulhamid
aa048974db Deprecate SkinTemplateBuildNavUrlsNav_urlsAfterPermalink hook
Bug: T254431
Change-Id: I2ad144ac7aa5b0243f070b350b7dfc61ee466743
2020-06-12 22:21:13 +01:00
jenkins-bot
a2812b8a6a Merge "Rename CoreMagicWords to CoreMagicVariables and update docs" 2020-06-12 19:18:02 +00:00
Tim Starling
a30b328bd4 Rename CoreMagicWords to CoreMagicVariables and update docs
There's already a thing called magic words, and this is not it. These
things are called variables. There are many usages of this term in the
source. The term was introduced by Lee in 2002: originally
OutputPage::replaceVariables() contained only this functionality.

I introduced the term "magic word", meaning a localizable keyword.
Localizable keywords are an abstraction not limited to this use case.

"Magic variables" is a neologism, but I suppose it is permissible, since
it disambiguates. Whereas calling a variable a magic word conflates rather
than disambiguates.

Fix terminology in magicword.md and update the examples.

Change-Id: I621c888e3790a145ca9978f6b30ff1a8f685b64c
2020-06-11 13:28:45 +10:00
jenkins-bot
766d9299fb Merge "Rename MagicWordwgVariableIDs hook to GetMagicVariableIDs" 2020-06-11 02:59:19 +00:00
Reedy
d019a0775f s/slave/replica
Bug: T254646
Change-Id: I8397fc890e5ca19e28c50422ba056ff42e9fe23f
2020-06-11 00:50:10 +00:00
jenkins-bot
f34d26672e Merge "Add PageSaveComplete hook to replace PageContent(Insert|Save)Complete" 2020-06-10 21:02:49 +00:00
DannyS712
0e915c0b63 Add PageSaveComplete hook to replace PageContent(Insert|Save)Complete
Bug: T250566
Change-Id: I8e515ad9d344cb31e59bcfc87a717ca2b93feee2
2020-06-10 20:41:00 +00:00
DannyS712
1594282ad0 Replace TitleMoveCompleting and TitleMoveComplete hooks
Bug: T250023
Change-Id: Iceb0aebb51769c413bf560d1c5b70a7213cb8b91
2020-06-10 20:03:31 +00:00
C. Scott Ananian
2c9d496268 Rename MagicWordwgVariableIDs hook to GetMagicVariableIDs
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
2020-06-10 12:28:20 -04:00
mainframe98
4e2897575a Replace BaseTemplateAfterPortlet with SkinAfterPortlet
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
2020-06-09 21:51:58 +00:00
jenkins-bot
90d8df020d Merge "mediawiki.diff: Reduce selectors and remove obsolete documentation HTML page" 2020-06-05 17:57:19 +00:00
jenkins-bot
9838d7bb25 Merge "Introduce soft deprecation of hooks" 2020-06-05 16:02:39 +00:00