Commit graph

134 commits

Author SHA1 Message Date
Petr Pchelko
89028e0b8e Move limit report rendering to ParserOutput
This does not move the actual limit report data into
ParserOptions yet, that should be done separately
given that it will require serialization changes.
Let's get this change settled first before messing
with serialization.

This unifies canonical and non-canonical ParserOptions,
so ParserCache can now be used with both. It is hard
to say how this will affect the ParserCache capacity,
so we should monitor it after releasing this.

Change-Id: I154c0a77a5b0287b5572614d56339fb57ac56c33
2021-11-08 12:45:41 -08:00
Petr Pchelko
928f707731 Remove old HTTP request implementations
Since 1.34 setting non-default HTTP engine
has been deprecated. It's time to remove
the old implementations. Only Guzzle is
now available.

Change-Id: I978b75827e69db02cbc027fe0b89a028adfc6820
2021-11-08 07:04:06 -08:00
vladshapik
aac67c6c38 Drop User methods which were deprecated since 1.37
The following User methods, deprecated in 1.37, have been removed:
- ::resetIdByNameCache,
- ::getStubThreshold,
- ::matchEditTokenNoSuffix,
- ::changeableByGroup
- ::changeableGroups,
- ::isAllowUsertalk
ActorStore::clearCaches() has been removed, since User::resetIdByNameCache
has been removed. User::$mAllowUsertalk has been removed, since
User::isAllowUsertalk has been removed.

Bug: T277511
Change-Id: I608a5277924fc50cc3d9fca6ba958bc6d9c321d0
2021-11-06 07:24:08 -07:00
Petr Pchelko
db5cb74486 Upgrade to Shellbox 3.0.0
Depends-On: Idfe35c788a84f04a760edb01c0bf48ddc8accb1f
Change-Id: Ib5ffeec5bb6b45ea7fb93aec8df4368231188b67
2021-11-05 08:31:26 -07:00
jenkins-bot
ffb80447cf Merge "File: remove deprecated methods" 2021-11-05 15:17:46 +00:00
jenkins-bot
43fa5b2298 Merge "RELEASE-NOTES-1.37: Move comment from 20fd877 to 1.38, this missed the cut" 2021-11-04 21:29:31 +00:00
James D. Forrester
648652432b RELEASE-NOTES-1.37: Move comment from 20fd877 to 1.38, this missed the cut
Change-Id: I86bd08ed70d4bb7f39bb34a0dd5351e6f85782fc
2021-11-04 21:00:23 +00:00
Volker E
2d25498471 Update OOUI to v0.42.1
Release notes:
 https://gerrit.wikimedia.org/g/oojs/ui/+/v0.42.1/History.md

Bug: T283812
Bug: T287329
Bug: T288928
Bug: T289043
Bug: T289043
Bug: T290792
Bug: T290975
Bug: T291142
Bug: T291284
Bug: T293274
Bug: T293635
Depends-On: I0918c0c866147e6a103ce8815b7a36d0463457b7
Change-Id: I717ff53e18e95c72ace1c46b6236cfecb5cd8217
2021-11-04 19:39:43 +00:00
Roan Kattouw
10fae048df Add Vue composition API plugin
Feature code that needs the composition API will need this as long as
we're still on Vue 2. This will also help migrate to Vue 3 more
seamlessly, as working around some breaking changes in Vue 3 requires
using the composition API.

Bug: T251974
Change-Id: I8e334ae5f447a8f9b64a7c910b2c1776cef118db
2021-11-03 23:15:57 +00:00
Petr Pchelko
a7b0143c57 File: remove deprecated methods
Change-Id: I961e62f812f2e1b86b858be7eeee8bc042542689
2021-11-01 19:58:21 -07:00
Volker E
4c47d37688 Update WVUI to v0.3.2
Release notes: https://gerrit.wikimedia.org/r/plugins/gitiles/wvui/+/refs/tags/v0.3.2/CHANGELOG.md#v0_3_2-2021_11_01

Bug: T290392
Change-Id: I8fb7761e60be330e58cd017872318fe3675c0be1
2021-11-01 17:39:44 -07:00
Roman Stolar
957697e1e0 Hard-deprecate Content::getParserOutput and AbstractContent::fillParserOutput.
Use ContentRenderer::getParserOutput instead.
Extensions defining a content model should override ContentHandler::fillParserOutput.
Update tests.

Bug: T287158
Change-Id: I1c71a8429806f1813a39f5807256b2eb9fb9901f
2021-10-29 14:04:22 +03:00
Nicholas Ray
d99dd4040e [BREAKING] Change cleanup API of checkboxHack
Before this commit, each bind function would return an object containing
a reference to the function used in the event listener creation with the
intention that this could later be used to cleanup the event listeners.
This is problematic for the following reasons:

* In order to cleanup the event listener, it forces the client to know
which element the event listener was added to (button, checkbox,
document, window, etc.),. the event type that was used ('click',
'focusin', etc), and whether or not the "useCapture" param was also
used. The `removeEventListener` API won't remove the correct event
listener unless these three pieces of info are known by the client [1].

* Because the above point is tricky to get right, numerous potential
memory leaks were possible with the `unbind` function as the
`useCapture` param wasn't being passed in some cases.

This commit aims to simplify the cleanup API by returning an anonymous
function in each bind function that the client can call to cleanup the
relevant event listeners without knowing any of the implementation
details. This also makes the `unbind` function unnecessary.

** This is a breaking change to the checkboxHack API ** but because
there aren't any known clients of the return values [2], a formal
deprecation process was assumed to be unnecessary. Note gadgets should
not be using the internal function mw.loader.require so these were
not considered.

[1] https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener#matching_event_listeners_for_removal
[2] https://codesearch.wmcloud.org/search/?q=checkboxHack&i=nope&files=&excludeFiles=&repos=

Bug: T291096
Change-Id: Ia2d79f27dd81fdc74a44829da3ca472f4c01d4b5
2021-10-27 18:25:49 +00:00
jenkins-bot
e0f7759256 Merge "Hard deprecate LinkCache::addGoodLinkObj" 2021-10-26 15:51:05 +00:00
vladshapik
1ae8e89eb5 Hard deprecate LinkCache::addGoodLinkObj
LinkCache::addGoodLinkObj was hard deprecated.
Use addGoodLinkObjFromRow() instead. PHPUnit tests
must use LinkCacheTestTrait::addGoodLinkObject().

Bug: T284955
Change-Id: I0c22be2f00e6d6d4ba6dd1511c5385cad55e8ff7
2021-10-26 18:21:32 +03:00
jenkins-bot
3327b4a1a1 Merge "Cleanup hard-deprecated code in blocks." 2021-10-26 14:41:09 +00:00
Petr Pchelko
25bb5b296a Cleanup hard-deprecated code in blocks.
Change-Id: I1b3f4a0f072197c6b3dc6c9a80fcb2946aeb6360
2021-10-26 06:44:05 -07:00
Petr Pchelko
164ec5cb29 UserOptions: remove deprecated hooks.
After the hooks were removed we are finally ready to stop
reading user options from primary before writing them on save.
The new save hooks only work on modified options, so options
saving code can be significantly simplified.

Change-Id: I48df616c9f35d9a0b2801ada1b7dbef0bd4ad058
2021-10-26 12:55:01 +00:00
Tks4Fish
76e3701d6a OutputPage: Remove $wgLoggedOutMaxAge experiment and related tests
Bug: T293848
Change-Id: I5e5e52fac7fe389b36715dae11cc30cdb2b9136a
2021-10-25 19:33:32 +00:00
Matěj Suchánek
61289e0290 Deprecate replaced PageArchive methods
Change-Id: I07fe12e6e96c6a27b66655f179c09f624180daa3
2021-10-21 18:28:03 +02:00
Alexander Vorwerk
ec2cd3dc37 Hard-deprecate remaining MWNamespace methods
MWNamespace has been deprecated in favor of the NamespaceInfo
service in 1.34 and should no longer be used.

All methods are unused in wikimedia-deployed extensions.

Bug: T291389
Change-Id: Ibe2069dea1af983d8fda53e734396c5a7a8b7321
2021-10-20 21:16:25 +02:00
Amir E. Aharoni
d7c1b8999e Add the Farefare language (gur) to Names.php
Bug: T293656
Change-Id: I4c6f0af1ce7f8e8e54a07b2ac78c0507c9b0bb31
2021-10-18 18:28:45 +03:00
C. Scott Ananian
ffb0dfc87b Hard deprecate ParserOutput::addWarning()
Code search:
https://codesearch.wmcloud.org/deployed/?q=%5BOo%5Dutput%28%5C%28%5C%29%29%3F-%3EaddWarning&i=nope&files=&excludeFiles=&repos=

Other uses in non-production code:
Id96ba92b46ae57a385b7096a02a63ad5eddf566e (BlueSpiceBookshelf)
I8eb6733d676a56f6a03b9798d3c4022493c01d04 (PageInCat)
I9cb8d36caf4326b3c3d02362cd06f2d4093b5a8e (TEI)

Bug: T293515
Depends-On: I352d161dc276c6684b0532b62c0e676a4d05cdfd
Depends-On: Ib51c75e38b9bf490b4ded481ee92ede0949f272e
Change-Id: I99cfbfbecf134366d1a97e67c46d0abc0af22d26
2021-10-15 16:27:24 -04:00
C. Scott Ananian
4834340ec0 Deprecate ParserOutput::addWarning() in favor of ::addWarningMsg()
Encourage localization and factor out common code by taking a message
key as the first argument to ::addWarningMsg() instead of a wikitext
string.  This also plays nicer with Parsoid by separating out the
localization code from the parse.

Bug: T293515
Change-Id: I6a7c04c67ac586ab00d4edcbb3d09485a7794e23
2021-10-15 16:06:13 -04:00
C. Scott Ananian
06ab90f163 Add new ParserOutput::{get,set}OutputFlag() interface
This is a uniform mechanism to access a number of bespoke boolean
flags in ParserOutput.  It allows extensibility in core (by adding new
field names to ParserOutputFlags) without exposing new getter/setter
methods to Parsoid.  It replaces the ParserOutput::{get,set}Flag()
interface which (a) doesn't allow access to certain flags, and (b) is
typically called with a string rather than a constant, and (c) has a
very generic name.  (Note that Parser::setOutputFlag() already called
these "output flags".)

In the future we might unify the representation so that we store
everything in $mFlags and don't have explicit properties in
ParserOutput, but those representation details should be invisible to
the clients of this API.  (We might also use a proper enumeration
for ParserOutputFlags, when PHP supports this.)

There is some overlap with ParserOutput::{get,set}ExtensionData(), but
I've left those methods as-is because (a) they allow for non-boolean
data, unlike the *Flag() methods, and (b) it seems worthwhile to
distingush properties set by extensions from properties used by core.

Code search:
https://codesearch.wmcloud.org/search/?q=%5BOo%5Dut%28put%29%3F%28%5C%28%5C%29%29%3F-%3E%28g%7Cs%29etFlag%5C%28&i=nope&files=&excludeFiles=&repos=

Bug: T292868
Change-Id: I39bc58d207836df6f328c54be9e3330719cebbeb
2021-10-15 14:25:54 -04:00
C. Scott Ananian
8979eb0c57 Mark ParserOutput::getAllFlags() @internal
This function, added in 1.34, does not appear to be used outside core:

https://codesearch.wmcloud.org/search/?q=-%3EgetAllFlags\%28\%29&i=nope&files=&excludeFiles=&repos=

It currently exposes representation details of ParserOutput (that is,
whether a boolean flag is stored in an explicit property, in the
$mFlags array, or in the $mExtensionData array) and so it would be
best not to expose it outside core so as to facilitate any future
change in the internal representation of ParserOutput.

Bug: T292868
Change-Id: I7b6d309425ff01dc211334b848068d0b9c0f9261
2021-10-15 14:24:54 -04:00
C. Scott Ananian
6bf78153bf Hard deprecate ParserOutput::addTrackingCategory()
Non-WMF-deployed patches:
I403b646852064fed22e8e9bbfadd221990363881 (CollaborationKit)

Code search:
https://codesearch.wmcloud.org/search/?q=%5BOo%5Dutput%28%5C%28%5C%29%29%3F-%3EaddTrackingCategory%5C%28&i=nope&files=&excludeFiles=&repos=

Depends-On: I339a14907c8059c52ffce5d8a554e97f1f0b58d6
Depends-On: Ie6a09796b908dd105ec17d5a1f0f9586eed9bd8c
Depends-On: I983d370a03413086acafe7e67a2b812400e1a38d
Depends-On: Ie41ad70f1fb5de202355314a96a1243234fb267c
Depends-On: I715f788c5026a6c07d4995980a4fcc6c8b84e2b4
Depends-On: I1330a806febf898b3a0a2998fac857f0f737a0a3
Change-Id: I340c138f26e25ce971a46470a4da02d011b5a638
2021-10-15 14:18:26 -04:00
C. Scott Ananian
9632dfb041 Move ::addTrackingCategory() implementation to TrackingCategories
This moves the implementation of ParserOutput::addTrackingCategory()
to the TrackingCategories class as a non-static method. This makes
invocation from ParserOutput awkward, but when invoking as
Parser::addTrackingCategory() all the necessary services are
available.  As a result, we've also soft-deprecated
ParserOutput::addTrackingCategory(); new users should use the
TrackingCategories::addTrackingCategory() method, or else
Parser::addTrackingCategory() if the parser object is available.

The Parser class is already kind of bloated as it is (alas), but there
aren't too many callsites which invoke
ParserOutput::addTrackingCategory() and don't have the corresponding
Parser object handy; see:

https://codesearch.wmcloud.org/search/?q=%5BOo%5Dutput%28%5C%28%5C%29%29%3F-%3EaddTrackingCategory%5C%28&i=nope&files=&excludeFiles=&repos=

Change-Id: I697ce188a912e445a6a748121575548e79aabac6
2021-10-15 14:17:58 -04:00
C. Scott Ananian
06fe601bf2 Hard deprecate ParserOutput::{get,set}CategoryLinks()
There are no uses in deployed Wikimedia production code.

The following patches are to other users:

I55f4325073cc01a706708b0391f2561090075be6 (BlueSpiceEchoConnector)
I244e5740ca02d05164553799cf0dab94a0b5c197 (NoCat)
I1602650991121dceb62d57c1f5b10359213183db (PageInCat)
https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/5094 (SemanticMediaWiki)

Code search:
https://codesearch.wmcloud.org/search/?q=-%3E%28get%7Cset%29CategoryLinks%5C%28&i=nope&files=&excludeFiles=&repos=

Bug: T287216
Change-Id: I6b472f20b7d90b5be7f485f20b91821e2d756944
2021-10-15 09:57:13 -07:00
C. Scott Ananian
5ae946d3a6 Rename ParserOutput::setCategoryLinks() and ::getCategoryLinks()
Make ::setCategory() consistent with the corresponding singular method,
which is ::addCategory(), not ::addCategoryLink().  Also, don't return
a value.

This renaming is in preparation for factoring out a write-only base
class from ParserOutput suitable to be used by Parsoid.

Note that OutputPage does distinguish a 'category link' from a
'category list', and there are separate OutputPage::getCategories()
and OutputPage::getCategoryLinks() methods.  However, the category
map in ParserOutput isn't exactly the same as either of these:
it's actually a map (or list of pairs) of category name to sort key.

Rename ParserOutput::getCategoryLinks() to ::getCategoryNames()
in order to clarify that the concept involved is not the same as
the OutputPage "category links" methods.

Code search:
https://codesearch.wmcloud.org/deployed/?q=-%3E(get%7Cset)CategoryLinks%5C(&i=nope&files=&excludeFiles=&repos=

(Note that many of the code search matches are for the methods in
OutputPage, which we are trying to disambiguate here.)

Bug: T287216
Change-Id: Idb383d3d9ef7b76f8a0208a057a3cb8c639465c9
2021-10-15 09:45:36 -07:00
James D. Forrester
8384c72a0c RELEASE-NOTES-1.38: Re-write to be more useful & keep to standard form
Instead of a paragraph of prose listing things that are now gone, give
an actual list, and match the method with the replacement, rather than
having people have to scan each option.

We don't use the term 'hard deprecation' in user-facing documentation.

Change-Id: I9c4ac0bcf4464bbc28f4e6eb1a4c2bd2693f5668
2021-10-15 09:45:35 -07:00
jenkins-bot
65f67552e6 Merge "Hard deprecate the renamed ParserOutput::*Property() methods" 2021-10-14 19:26:28 +00:00
jenkins-bot
b281141368 Merge "Final sync of DeleteAction and FileDeleteAction forms" 2021-10-14 06:24:48 +00:00
jenkins-bot
f32e15c3f1 Merge "Make Parser::$mStripState private" 2021-10-14 03:10:56 +00:00
jenkins-bot
ec09bc8071 Merge "Remove cookie settings from mw.config" 2021-10-14 03:08:54 +00:00
C. Scott Ananian
3056737420 Make Parser::$mStripState private
This property was deprecated in 1.35.  The replacement function
Parser::getStripState() was introduced in MediaWiki 1.34.

Code search:
https://codesearch.wmcloud.org/search/?q=-%3EmStripState&i=nope&files=&excludeFiles=&repos=

Depends-On clauses below are for WMF-deployed code.  Other uses in
non-WMF-deployed code have been patched in:
* https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/4936
* Idc2fadf5105d6eb30777a16dff0035bceff17174 (BlueSpiceSocial)
* I130fd61a8fe2d28e6b116a3fcc767b8abd466cea (ContributionScores)
* I3676fe9882ce9de5732cb7230528134df544ff98 (HierarchyBuilder)
* Ic392afd1e93ae0003fd0ab65114ec1ff38bb2927 (Mpdf)
* I4b01017da752def982777c4fea5fad5e21e4c7ea (MsLinks)
* I09726078ee62eb99e032b8faa5f938e20107f48c (Negref)
* Ibfd6b7064a8e650c3492e0d2764d4f7afc4937bf (PageForms)
* Ia865435688d36178508f21cffae79538c919035c (PageInCat)
* Ib94db0e6d365e4cb3f51121340a04d31b88add62 (ParserFun)
* I8660c0691b7e9842106d7dcb224ff5ecf374e4bc (PhpTags)
* I1ad5f78e5a937767123400ceca4967941e256e5e (RandomImageByCategory)
* I4539e7cea597f71b2a2d9a6cae137bc25085ed6b (ReplaceSet)
* If8ff2e21952b3f08d3a8950d42e2afb56973fb89 (SemanticDrilldown)
* I4a5bd64760cdde5b614a7d4e2b09e8d0634b2056 (SemanticPageSeries)
* Ia04f1aac1d8ae4ea16c98cfbbe72195fffe653b6 (SemanticRating)
* Id2a2e2d024922e3babf756ebae1a4f59b4358146 (Spark)
* I4a979024b18ec4834dc06b51ee0f018d749c6dab (Tooltip)
* Iaf179914863998b32bfecc16c874c3cffd6c26e9 (VIKI)
* I2de0e7a6c133c2e1f3cb7502a81d809c4489db4c (XSL)
* https://gitlab.com/hydrawiki/extensions/characterescapes/-/merge_requests/1 (characterescapes)
* https://github.com/JeroenDeDauw/Validator/pull/38 (Validator)
* https://github.com/lingua-libre/CustomSubtitle/pull/3 (CustomSubtitle)
* https://github.com/mkroetzsch/AutoCreatePage/pull/12 (AutoCreatePage)
* https://gitlab.com/nonsensopedia/extensions/advancedbacklinks/-/merge_requests/95 (advancedbacklinks)
* https://github.com/vonloxley/Shariff-Mediawiki/pull/16 (Shariff-Mediawiki)

Bug: T275160
Depends-On: I062ac8b69756a7ad35d8cc744b4735fd2e70f13e
Depends-On: Ic4be2bad176f2c59a1104219be10045cd5929261
Depends-On: I3cb117a91c8c57331b6b513f64ddb68d6ae2758c
Depends-On: I67b5926f2f851b3dc709d044eec5dd3df5065482
Depends-On: I7806068e1cd6e4da66adfe7bb75095d4bfb5d6bc
Depends-On: I429da35ca4e276c852b8d6ee102ff19f742c22c0
Change-Id: I4af85a46cfcafba15aa5ee50fda9f7b04681d6e6
2021-10-13 19:58:50 -04:00
DannyS712
4598d556f5 Remove cookie settings from mw.config
No longer used from there by the mediawiki.cookie module

No deployed javascript tries to use these, but a few undeployed
extensions do, so added to release notes.

Bug: T291760
Follow-up: I600332cdb738f0b443549948b9f070f3ccfa12aa
Change-Id: Ia02048137f191b950ae789a9d206c1d9afbce83a
2021-10-13 23:45:24 +00:00
Aaron Schulz
6132721973 objectcache: remove deprecated setDebug() method
Change-Id: I4702d7c8df2c0a645279ed59b6b7a9aa9e5cea34
2021-10-13 23:32:35 +00:00
jenkins-bot
9730926907 Merge "Move mediawiki.ForeignUpload configuration settings to package files" 2021-10-13 23:18:28 +00:00
Petr Pchelko
a1aa3e0827 Hard-deprecate all public property access on CacheTime and ParserOutput.
- Added a test where ParserOutput objects with CacheTime
properties set are unserialized from previous versions.
- Generate new serialization tests for 1.38

Now all serialization in production is JSON, so changing
property visibility shouldn't affect ParserCache.

Bug: T263851
Depends-On: I283340ff559420ceee8f286ba3ef202c01206a23
Change-Id: I70d6feb1c995a0a0f763b21261141ae8ee6dc570
2021-10-13 13:27:16 -04:00
Daimona Eaytoy
23ec8052ce Final sync of DeleteAction and FileDeleteAction forms
Fix the last drifts between the two. Custom CSS IDs/names/classes in
FileDeleteForm were replaced with the base one, as I think it's better
to be consistent, and it wouldn't be trivial to allow changing those
values in a clean way. Question for reviewers: should this part be
announced on tech news in case somebody is using those values in a
script?

Move the file delete intro above the form, like we do for normal
deletion.

For normal deletion, use the content of the wpReason field as default
value for that field, not the result of merging the dropdown and the
"other" field, which doesn't seem correct (the file version was already
doing this).

Make the file deletion form use the title as token salt like the base
form -- it shouldn't make any difference AFAICS.

After this patch, it should be possible to make DeleteAction extend
FormAction with low effort.

Bug: T288282
Change-Id: I8b115ecb1c94af63d686a575b18362ac32105ae2
2021-10-13 13:48:24 +00:00
Amir E. Aharoni
3893aab376 Add S'gaw Karen (ksw) to Names.php
Bug: T292612
Change-Id: I101a8f53b688730a52e4f031f43f1b875720587b
2021-10-13 15:44:41 +03:00
jenkins-bot
ad9255fe30 Merge "Remove deprecated ApiBase::PARAM_VALUE_LINKS" 2021-10-13 01:54:56 +00:00
Reedy
7accea74ec Upgrading wikimedia/wrappedstring (v3.2.0 => v4.0.1)
Depends-On: Ic26f3a3be1061b77e0af7b8c4c2569f9d070d191
Change-Id: I5a9f97cac52e4e9af612c2130359b017fb7176c1
2021-10-12 23:30:27 +00:00
Reedy
fb235068b8 Remove deprecated ApiBase::PARAM_VALUE_LINKS
Change-Id: I1c544ef58ebb2c83ebdcf7284a8dad2ed364c608
2021-10-09 01:44:42 +01:00
jenkins-bot
26cdf2cfb0 Merge "Upgrading psr/log (1.1.3 => 1.1.4)" 2021-10-08 22:56:18 +00:00
jenkins-bot
1fb55b0c57 Merge "Update pear/*" 2021-10-08 21:58:46 +00:00
jenkins-bot
549ff25cf1 Merge "DeleteAction-related cleanup, part 3" 2021-10-08 21:22:48 +00:00
Reedy
7735af1e27 Upgrading psr/log (1.1.3 => 1.1.4)
Change-Id: If11d0081355eb9caa157fb92389d92ac65b27d4e
Depends-On: I5c4006f5747075a92a78900606e196d33c6d9a8f
2021-10-08 21:51:56 +01:00
Reedy
659fd89408 Update pear/*
- Upgrading pear/mail_mime (1.10.9 => 1.10.11)
  - Upgrading pear/net_smtp (1.9.2 => 1.10.0)

Depends-On: Ib698ef15b6f97ea637aedcc6ef26860c8c4a2cd0
Change-Id: I287e148a9078866a55e5f04693406374d8cca976
2021-10-08 21:50:17 +01:00