Commit graph

105353 commits

Author SHA1 Message Date
jdlrobson
d3eda44624 registration: Make it easier to set a skin's templateDirectory
When originally introduced, a skin's templateDirectory was relative
to core, rather than the skin itself. Most skins needed to set
something like "skins/Example/templates", hardcoding the default value
of $wgStyleDirectory.

skin.json will now assume that the value of templateDirectory is
relative to the skin itself. If that directory doesn't exist, we'll
fallback and assume it's using the previous behavior of being relative
to core. In practice this should not be a breaking change since no skin
is expected to have a directory like "skins/Example/templates" inside
the skin itself.

Finally, ExtensionProcessor will set a default templateDirectory if
one isn't already set, so in most cases this setting should be able
to just be removed entirely.

Bug: T262067
Change-Id: I434b8a4319f3c8b65bcaab3465224058f31e7ae8
2021-08-27 00:22:38 -07:00
jenkins-bot
30ed970592 Merge "api: Improve class property docs in ApiContinuationManager" 2021-08-26 22:04:38 +00:00
Umherirrender
d0dd93b677 api: Improve class property docs in ApiContinuationManager
Change-Id: I5a5a3c68b2f2e04878bba55a038e58fede6f9d60
2021-08-26 21:38:06 +00:00
Daimona Eaytoy
d147cea39f WikiFilePage: Guard against null file in loadFile()
- Mark the file as loaded only if loading actually succeeded;
- Enforce the expectations of this class around mFile not being null
  with an exception. This should eventually be replaced with
  something better.

More details at T250767#6892136.

Bug: T250767
Change-Id: If01ae00a76597dcb3cbbede56c20ef0edefb57b1
2021-08-26 21:25:41 +00:00
jenkins-bot
1106a05430 Merge "docs: Remove wrong null types" 2021-08-26 21:04:20 +00:00
jenkins-bot
4a1d12da40 Merge "parser: Fix string replacement in post-expand error handling" 2021-08-26 20:01:23 +00:00
Umherirrender
c7817fca44 docs: Remove wrong null types
Change-Id: I017ff1a7fea0119b2a864c5fefb002afa7535cad
2021-08-26 21:42:03 +02:00
Umherirrender
44c1f2ebbe specials: Simplify handling for SpecialVersion descriptionmsg values
array_shift gives the first element,
no need to access it with array index

Change-Id: I178422092166a3036c0d2c09866096233487e8bc
2021-08-26 21:31:39 +02:00
Umherirrender
1c60425468 parser: Fix string replacement in post-expand error handling
Change-Id: If5f40efd05816616d65fa8d78686914c1bbe185e
2021-08-26 21:24:53 +02:00
jenkins-bot
ff7a116541 Merge "mediawiki.api: Move example doc from constructor to @class block" 2021-08-26 18:14:21 +00:00
jenkins-bot
8d2bdc20c2 Merge "Specify DB to query when checking if a user is blocked from a page" 2021-08-26 17:43:34 +00:00
jenkins-bot
756bfc0962 Merge "Add tests for the UserRightsProxy" 2021-08-26 16:46:17 +00:00
Bartosz Dziewoński
3f897fdd8f PageStore: Pass query flags to getPageById() too
Follows-up 8ba4aad647,
073c90e176.

Bug: T289717
Bug: T195069
Change-Id: I7b3c9c891d235d641cc623d518bb7ad78b297c5b
2021-08-26 17:58:19 +02:00
jenkins-bot
81897f50b8 Merge "Promote SkinMustache methods to SkinTemplate" 2021-08-26 15:23:24 +00:00
jenkins-bot
d472229e8e Merge "In Rest\ResponseFactory, substitute invalid UTF-8" 2021-08-26 10:50:10 +00:00
jenkins-bot
9ca18a249d Merge "benchmarks: Remove old bench, document perf -e instructions" 2021-08-26 09:18:49 +00:00
jenkins-bot
9f8cfab28d Merge "benchmarks: Set a default file in benchmarkJSMinPlus.php" 2021-08-26 09:18:43 +00:00
jenkins-bot
1437cb9bbd Merge "A few extra tests for Linker::formatComment()" 2021-08-26 09:12:41 +00:00
Thiemo Kreuz
4764a3dc06 Remove redundant class="" related condition from TablePager
The Html class does this already, since 2009 even:
https://phabricator.wikimedia.org/rMWf03c53b8a7a9dac33d3ef9947bf2fe5b6c354c9f

Change-Id: Ic002790417b2430fe6fce5cd37634c518eda80a2
2021-08-26 10:43:03 +02:00
DannyS712
00927d4c36 TablePager: don't call getRowClass twice when the result was saved
We have $class already

Change-Id: Ia78d313eb12597757bd9045ba9d1e71587e28d93
2021-08-26 07:04:52 +00:00
Tim Starling
32a2be8ec4 A few extra tests for Linker::formatComment()
For better coverage of the new CommentParser.

Change-Id: I70d20c8c1d190e1edf2568b6b3d119ccbe105ae4
2021-08-26 16:54:40 +10:00
Translation updater bot
521182b10f Localisation updates from https://translatewiki.net.
Change-Id: I786058c4dc4c9cc8ba163d9df3838c5e3a7ea091
2021-08-26 08:17:37 +02:00
Tim Starling
4c5de97a9b benchmarks: Remove old bench, document perf -e instructions
<https://gerrit.wikimedia.org/r/c/mediawiki/core/+/713031>

Change-Id: I60ec9a263a66747a1a5177584d3d04692f011e49
2021-08-26 05:53:49 +00:00
jenkins-bot
f7c7b53ee3 Merge "Clean up DeletePage" 2021-08-26 05:06:23 +00:00
Timo Tijhof
7d087c2819 benchmarks: Set a default file in benchmarkJSMinPlus.php
This makes it easier to run, but more importantly, makes it obvious
that the file in /data/jsmin is still conceptually in use.

Change-Id: Iaf10c9bd2f6643bcb0bae95eaf22ec92de15950d
2021-08-26 04:40:02 +01:00
jenkins-bot
c818f29a4c Merge "Add benchmark for Linker::formatComment() in preparation for refactor" 2021-08-26 03:24:38 +00:00
Tim Starling
2f6b427f40 In Rest\ResponseFactory, substitute invalid UTF-8
Most of the time this is due to garbage user input, and MediaWiki's
normal handling of user input strings is to normalize them, not to
throw.

There are some hypothetical cases where a developer might want to see an
exception, rather than passing garbage to the client and letting the
client fail, but normalization is a defensible policy and works within
the existing interfaces.

Bug: T289597
Change-Id: Ida5ee72c10d1c3499b5b17594c5675db7cd38335
2021-08-26 08:58:45 +10:00
jenkins-bot
9a436242c5 Merge "objectcache: Ignore "failed to set" warning from php-memcached" 2021-08-25 22:33:52 +00:00
jenkins-bot
1b0a5dfb51 Merge "Add custom tooltip messages for menu icons" 2021-08-25 21:26:53 +00:00
Bartosz Dziewoński
073c90e176 PageStore: Pass query flags to getPageByName()
Follows-up 8ba4aad647.

Bug: T289717
Bug: T195069
Change-Id: I2a614915c7d9ffbc4f466204b2684478fb52f30e
2021-08-25 19:59:03 +00:00
Clare Ming
522a41d9d8 Add custom tooltip messages for menu icons
Bug: T287494
Depends-On: I84ce6a1eb2a37eb9ea71a40c565c059d156a44ba
Change-Id: I9eac756f263a2b9dd595938ceeacff4607d710f9
2021-08-25 15:57:31 +00:00
jdlrobson
6c5b077830 Promote SkinMustache methods to SkinTemplate
Methods are promoted upwards from SkinMustache to SkinTemplate
in preparation for them being shared between SkinMustache and
BaseTemplate.

This is mostly a move of existing functions in SkinMustache but
also introduces SkinTemplate::getTemplateData and updates SkinMustache
to call the parent function.

Bug: T263213
Change-Id: I028364eb91e907c2f51529aac495df1eaca7b466
2021-08-25 15:39:26 +00:00
Roman Stolar
642afef215 Hard-deprecate Content::preSaveTransform.
Use ContentTransformer::preSaveTransform instead.
Extensions defining  a content model should override ContentHandler::preSaveTransform.

Bug: T287156
Change-Id: I2a8c60470366fd95d056e0dfa8144f209bb7117e
2021-08-25 16:14:59 +03:00
Alexander Vorwerk
b1973d9a2d Add tests for the UserRightsProxy
Change-Id: I6e369fe37cecd783b1ed163ccb36cc5d4b5182a4
2021-08-25 13:02:16 +00:00
jenkins-bot
7a957145ad Merge "Hard-deprecate Content::preloadTransform." 2021-08-25 11:26:03 +00:00
jenkins-bot
c03a36a48a Merge "Introduce concept of generateHTMLOnEdit() for ContentHandler" 2021-08-25 10:17:31 +00:00
Amir Sarabadani
66a4b414e5 Introduce concept of generateHTMLOnEdit() for ContentHandler
This way you can avoid rendering HTML and storing ParserCache entries

Bug: T285987
Change-Id: I3c7023b776f2a1e35dafdbb6ac0eb3eb73ae5fd4
2021-08-24 22:40:46 +02:00
jenkins-bot
89259d5a61 Merge "Inject services into Collation classes" 2021-08-24 17:53:21 +00:00
jenkins-bot
ae8522b34c Merge "Same code style and formatting for exists-style SQL queries" 2021-08-24 17:44:17 +00:00
jenkins-bot
f5b4075a50 Merge "Selenium tests: Skip wikitext-specific tests if NS isn't wikitext" 2021-08-24 17:18:28 +00:00
Timo Tijhof
1917ed656c mediawiki.api: Move example doc from constructor to @class block
For 99% of JS classes, there is no constructor description and instead
the class/constructor are defined together followed by both `@class`
and `@constructor` in the same block. These are interpreted as the
description belonging to the class and prominently displayed in the
documentation.

For the very rare cases where a constructor has its own description,
this must follow the tag rather than preceed it. This makes sense
when thinking about it in terms of how classes are usually defined
(above the constructor, and thus the space above `@constructor`
already belongs to `@class`).

This has the unfortunate side-effect, however, that when a constructor
is documented on its own, that any text above `@constructor` is
ignored, as happened with mw.Api.

But, as so often with strict documentation warnings, it helped uncover
a mistake. The text here is quite useful and not really specific to
the constructor and more broadly useful for the module as a whole,
as such I moved it to the class block.

Also:

* Clean up the code by bringing the class and constructor definition
  back together.

* Fix warning about invalid internal reference:
  > Warning: /resources/src/mediawiki.api/index.js:3: {@link https://…}
  The `@see` tag is only valid when referring to another index entity.
  There were three other uses of `@see` with a URL in core, but only in
  `@ignore`-ed code, which this commit fixes at the same time.

  Follows-up a28b76abe9.

* Use local `var` declarion for `promises`, since "one-var" style
  is no longer current.

Change-Id: I2d4f8b99c2896d4e1af50956c9faa8b36344884e
2021-08-24 16:38:26 +00:00
James D. Forrester
31933c28ee Update wikimedia/wait-condition-loop from 2.0.1 to 2.0.2
Bug: T289176
Bug: T287972
Depends-On: I009fde18d039ede388a758021651961f0c0f13b0
Change-Id: I9bf513183672e83ded09647de79e36c407b1fa01
2021-08-24 16:21:10 +00:00
James D. Forrester
66e9dab5f5 Selenium tests: Skip wikitext-specific tests if NS isn't wikitext
Change-Id: I2745532e5c9b2204fd2ee87ced004abd13dd4d4b
2021-08-24 08:53:42 -07:00
jenkins-bot
c039f2db81 Merge "Simplify loops over array_keys" 2021-08-24 13:19:38 +00:00
jenkins-bot
a3245767f1 Merge "pager: Simplify loop in AlphabeticPager" 2021-08-24 13:19:32 +00:00
jenkins-bot
bd0e36c3ca Merge "phpcs: remove class name exclusion for invalidateUserSessions" 2021-08-24 12:15:57 +00:00
jenkins-bot
40c423d441 Merge "Simplify if-then-else-return statements with explicit true/false" 2021-08-24 11:44:23 +00:00
DannyS712
57139640c5 phpcs: remove class name exclusion for invalidateUserSessions
Follow-up: I0c0f5c94a7ee0aa3f0aeb8b7f84857022810f17a
Change-Id: I0e24cf641ad16330ee152e80dbcad6a2f71a7001
2021-08-24 11:40:09 +00:00
jenkins-bot
62a1c353bc Merge "Fix class name of InvalidateUserSessions" 2021-08-24 11:27:34 +00:00
Translation updater bot
343893f985 Localisation updates from https://translatewiki.net.
Change-Id: If72890b60dff7d2af3440295036ab8d6d6296bff
2021-08-24 11:38:17 +02:00