Commit graph

104299 commits

Author SHA1 Message Date
DannyS712
3fe579f832 Increase length of automatic edit summaries to current maximum
Bug: T221617
Change-Id: I6cc4fb1678d542b90a3c4d652261483f98108e31
2021-06-19 03:16:51 +00:00
jenkins-bot
43015c24c2 Merge "diff: Fix and update type hints in DiffOp classes" 2021-06-19 00:23:26 +00:00
Thiemo Kreuz
2ba01c7ee7 Remove some more comments that literally repeat the code
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.

Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
2021-06-18 21:23:56 +00:00
jenkins-bot
f2877a80ba Merge "Add and fix various type hints in PHPDocs" 2021-06-18 21:14:30 +00:00
jenkins-bot
5028fe175d Merge "Remove User::$mEditCount and internal caching" 2021-06-18 17:57:35 +00:00
Petr Pchelko
eccd347da9 Hard-deprecate User::matchEditTokenNoSuffix
This feature was added to provide a custom error message
if the edit token was present, but trailing slashes were
stripped from it by some ASCII mangling proxy. According
to metrics this has happened 5 times last month, which
IMHO doesn't justify having special handling. Giving a
regular token mismatch error message should be good enough.

Depends-On: Ieb4f6e25a74ecaa1110c59a8d8eed3ca792f2d41
Change-Id: I85759e315581f891721dfac246daaafe956ab201
2021-06-18 09:42:24 -07:00
jenkins-bot
588de62855 Merge "Stop calling private Article::$watchlistManager" 2021-06-18 15:57:16 +00:00
jenkins-bot
e542cd31b2 Merge "Remove WatchedItem::getUser, deprecated and unused" 2021-06-18 14:40:17 +00:00
jenkins-bot
6ddc3cce59 Merge "api: Fix prefixsearch returning the entire database" 2021-06-18 13:38:11 +00:00
jenkins-bot
192ba91415 Merge "mw.errorLogger: Clarify documentation" 2021-06-18 11:52:29 +00:00
jenkins-bot
f93e78f7fe Merge "filerepo: Fix parsing metadata in ForeignAPIFile" 2021-06-18 11:28:21 +00:00
Gergő Tisza
2e487db9f7 mw.errorLogger: Clarify documentation
Change-Id: Ie418e91fee520f7e92ea0cc84aa813165000a39f
2021-06-18 12:03:41 +01:00
Alexander Vorwerk
6ba14162be Stop calling private Article::$watchlistManager
Bug: T285127
Change-Id: I4945beacc613b2bafc4e2e5edf1b5f5683993c3b
2021-06-18 10:19:31 +00:00
Thiemo Kreuz
51777ee8c1 Add and fix various type hints in PHPDocs
Random fixes I collected the past weeks in my local dev
environment.

Change-Id: Ic8a6262fd28e05cb57335f2faf390a47ff97dbaa
2021-06-18 08:19:23 +00:00
Thiemo Kreuz
f383e7c548 diff: Fix and update type hints in DiffOp classes
This patch adds and updates documentation. The most significant
changes are:
* getOrig() and getClosing() can return false. However, this is
  only possible for add and remove operations. These have only
  one side.
* The constructors of the subclasses are not meant to accept
  false, and are in fact never called with false. For the same
  reason. Only add and remove operations are allowed to miss
  one of the two sides.

Change-Id: I9f45f34945e0297e1ea8d3e8ff9e9c53e60e7706
2021-06-18 08:17:54 +00:00
Translation updater bot
6476733a02 Localisation updates from https://translatewiki.net.
Change-Id: Ifcc6f05e4d5fdea59a172f35d3b6e7011d5ba79f
2021-06-18 08:19:58 +02:00
DannyS712
2915e0bbbf DefaultPreferencesFactory: inject and use UserOptionsManager
Inject a UserOptionsManager instead of UserOptionsLookup, and
update deprecated calls to user options methods

Bug: T277600
Bug: T277818
Change-Id: Ifdf491c3fd6b5b16246f33012f1db21f2cbc1f3e
2021-06-17 17:27:40 -07:00
DannyS712
b82cf00983 Remove User::$mEditCount and internal caching
UserEditTracker now returns null for anonymous users
instead of throwing an exception.

Added new UserEditTracker::setCachedUserEditCount()
method (internal) to handle the user_editcount field
in User::loadFromRow()'s row. This now means that
the creation of one User object can set the cached
value for any other object for the same underlying user
- the alternative (just ignoring the value) would mean
that an extra database read might be needed. This is
only used for users created with a row that includes
the user id - we silently discard the value if
the row doesn't have a user id (or the user id is 0)
to avoid issues with UserEditTracker trying to fetch
the user id and potentially triggering another load.

A follow-up will simplify the UserEditCountUpdate class
to remove storing full UserIdentity objects now that
only the id is needed.

Follow-up: Ibf1482bcbcbf4d56fc06531bb3e17e2a6e3e2e6f
Change-Id: Ie3fb4887d9f2d96b32598865030351bf3bf20ce5
2021-06-18 00:25:47 +00:00
jenkins-bot
52cc0ce6ba Merge "DefaultPreferencesFactory: inject all services needed" 2021-06-18 00:04:19 +00:00
Petr Pchelko
7fbe4ced2d Remove WatchedItem::getUser, deprecated and unused
Bug: T274972
Change-Id: I045d0d1a402a1045389d039a9276de0a46809388
2021-06-17 14:04:00 -07:00
jenkins-bot
f849052e3b Merge "Deprecate LocalFile::getHistory hook" 2021-06-17 16:26:05 +00:00
jenkins-bot
32ad740e8c Merge "Add getLazyReadConnectionRef() to ConnectionManager" 2021-06-17 15:06:41 +00:00
Thiemo Kreuz
26bd5ff256 api: Fix prefixsearch returning the entire database
As of now, an input like "[" that contains nothing but invalid
characters behaves odd: The prefixsearch API returns the entire
database, alphabetically ordered.

This behavior exists ever since this code was introduced in
Iaffe30a (2014).

While this might be used as a "feature", I really don't think it
is intentional:
* The way the code is arranged executes an SQL query with a
  pointless `LIKE '%'` that doesn't do anything but possibly
  wasting CPU resources. This doesn't look intentional.
* There are much better APIs when you really want to list all
  pages.
* I would expect an input like "*", "%", or "" to return all
  pages. But neither of these inputs does this. Only some very
  strange inputs like "[" do.
* I would argue that "[" should behave the same as "", i.e. as
  if no useful input is given.
* Since I877297f (2020) we normalize e.g. "[[foo]]" to "foo",
  for convenience. Since then such an input works as expected,
  instead of returning the entire database. This leaves titles
  that contain nothing but invalid characters as the only
  edge-case.

Change-Id: Ib2cbf315ed7c3736391362be6d69599c58e690db
2021-06-17 16:25:43 +02:00
jenkins-bot
bc9bc0d07f Merge "selenium: Remove debugging information for video recording" 2021-06-17 11:48:13 +00:00
Željko Filipin
f6fa7f5fee selenium: Remove debugging information for video recording
All other debugging information (screenshots, webdriverio, mwbot) is
already  removed.

Bug: T284335
Change-Id: I27eb5053c35b4d7813315f3001c07d469fe9cbd2
2021-06-17 13:06:32 +02:00
jenkins-bot
224fca0c6c Merge "Selenium watchlist tests: don't create a new account" 2021-06-17 07:39:51 +00:00
Amir Sarabadani
5d1badae5d Deprecate LocalFile::getHistory hook
This undocumented hook which is only used in FlaggedRevs (and it's being
removed in If5a56a8fd5fc568) doesn't serve much purpose and can break
the file class.

Bug: T284777
Change-Id: I7ed8c01f0d0485f40307a24cc33cf3536f70c417
2021-06-17 08:33:31 +02:00
Translation updater bot
4362485407 Localisation updates from https://translatewiki.net.
Change-Id: Ia9edde7883b76bb3cf323f2dc42c40a539817271
2021-06-17 08:20:01 +02:00
Matěj Suchánek
ae7fa75b6a Fix documentation of UserEditCountUpdate::doUpdate
The original documentation was probably copied from somewhere else.
It never corresponded to what the method actually does.

Change-Id: I21491ec97cc24a36450466a090079f63402c8c1c
2021-06-16 22:48:56 +00:00
Alexander Vorwerk
a1f38c7d6f ApiExpandTemplates: inject services
Bug: T259960
Change-Id: I910b5a7b81c87471c2bd4694ba812fe6da8e6283
2021-06-16 22:25:02 +02:00
Lucas Werkmeister
85846c442c Add getLazyReadConnectionRef() to ConnectionManager
This can be used to replace calls like this:

    $loadBalancer->getLazyConnectionRef( DB_REPLICA )

I’m not adding a corresponding getLazyWriteConnectionRef() method yet,
because I’m not sure it would make sense (you would want to write to the
database, but only later?). That said, if someone else has a use for it,
don’t let me stop you from adding it :)

Bug: T285042
Change-Id: Icdbf5a170f2ae4e0ea4ee144a801fadfda932cd3
2021-06-16 15:57:05 +02:00
Translation updater bot
eedd3293b7 Localisation updates from https://translatewiki.net.
Change-Id: I47f2e894e632577942f9871f3c2eefede49be6dd
2021-06-16 08:18:53 +02:00
bwang
085a15211f SkinMustache: Add html-before-portal default value
To mirror the html-after-portlet template variable, it will
be possible for skins to define HTML before a portlet. For now
this can only be modified by skins.

Depends-On: I32586a379cbacaad5cfb361facf79c01e982818a
Change-Id: Ia64e7d4009cf303494ff455e1596286bcca811d9
2021-06-15 21:34:12 +00:00
Umherirrender
4f602d4d01 Use HTMLForm::setWrapperLegend and ::setSubmitTextMsg to set messages
setWrapperLegendMsg and setSubmitTextMsg are calling Message::text
Replacing setSubmitText + Message::text with setSubmitTextMsg makes the
code easier to read

Change-Id: I73389991fea82e1927027dc95c3debc3d8c15939
2021-06-15 18:56:49 +00:00
jenkins-bot
86eca4c9b2 Merge "Remove unused User::initEditCountInternal" 2021-06-15 18:20:16 +00:00
jenkins-bot
61875d7408 Merge "Remove LocalFile::recordUpload2" 2021-06-15 18:18:58 +00:00
jenkins-bot
64ac93c31c Merge "FileDeleteForm: inject services" 2021-06-15 17:10:46 +00:00
Alexander Vorwerk
cbc4c9dee2 FileDeleteForm: inject services
This patch adds dependency injection for FileDeleteForm

Change-Id: Ia63442e4bf9245405ba980ebc717b37ad2161e26
2021-06-15 18:22:44 +02:00
jenkins-bot
1923ce0996 Merge "stylelint: Enforce no-unsupported-browser-features" 2021-06-15 15:43:01 +00:00
Amir Sarabadani
65e875acbb filerepo: Fix parsing metadata in ForeignAPIFile
ForeignAPIFile::parseMetadata is a recursive function trying to parse the
metadata tree. We want to emit _error as value if the metadata returned
by API is not an array but at the same time, we broke when the function
reaches the leaves and tries to parse them making parseMetadata return _error
for all leaves instead.

This broke beta cluster. I tested this change on beta cluster and this
patch fixes it.

Bug: T275268
Change-Id: I2befa92a8f9619ba6eb990d461f0a6f0fa7a4677
2021-06-15 11:14:56 +02:00
DannyS712
f0620f4297 Remove unused User::initEditCountInternal
Method was marked as @internal and doesn't need to go through
deprecation.

Change-Id: Ibfe3677d1fbeedb89482d10cf74ebf3775c7673e
2021-06-15 07:51:50 +00:00
DannyS712
a95838c1f6 Remove LocalFile::recordUpload2
Hard deprecated, no remaining uses

Bug: T262708
Change-Id: I9f6f9197db105618e87c927503dee9011899d6a8
2021-06-15 07:04:33 +00:00
Translation updater bot
873118723c Localisation updates from https://translatewiki.net.
Change-Id: I9ebedc3b77f84e229241895838efaf0a69f8e02b
2021-06-15 08:31:32 +02:00
jenkins-bot
a5b19b1b68 Merge "Gently discourage LoadBalancerSingle/LBFactorySingle constructors" 2021-06-15 04:37:12 +00:00
jenkins-bot
efc9d4300a Merge "filerepo: Update outdated LocalFile comment about cache size" 2021-06-15 02:12:37 +00:00
Tim Starling
9c3c0b704b Use array_fill_keys() instead of array_flip() if that reflects the developer's intention
array_fill_keys() was introduced in PHP 5.2.0 and works like
array_flip() except that it does only one thing (copying keys) instead
of two things (copying keys and values). That makes it faster and more
obvious.

When array_flip() calls were paired, I left them as is, because that
pattern is too cute. I couldn't kill something so cute.

Sometimes it was hard to figure out whether the values in array_flip()
result were used. That's the point of this change. If you use
array_fill_keys(), the intention is obvious.

Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
2021-06-15 00:11:10 +00:00
jenkins-bot
1129e71774 Merge "Factor out data required for creating a logout link" 2021-06-14 21:30:56 +00:00
Jan Drewniak
d638cad995 Factor out data required for creating a logout link
Factors out logic that's responsible for assembling data for the logout
link in a public SkinTemplate::buildLogoutLinkData function.

This function is required by the new version of the Vector skin to
reposition the logout button outside of the personal tools menu.

Bug: T281791
Change-Id: If82a736e37174aaadd0ff07019a1fae3759a9e51
2021-06-14 23:11:29 +02:00
bwang
0448859ab6 Hard deprecations of portlet methods and hooks
Hard deprecates BaseTemplate::getAfterPortlet
Hard deprecates BaseTemplate::renderAfterPortlet
Hard deprecates BaseTemplateAfterPortlet Hook

Bug: T280608
Depends-on: I15ed3c820823782d28f11f3724d56736db0ca3e0
Depends-on: Ie00e8c5efe9a1e736251382344a7ae8cd779bb6b
Change-Id: If3e15aa81edb4190b5a74353c089b200acf3f62b
2021-06-14 19:28:46 +00:00
jenkins-bot
3ac949969c Merge "DatabaseInstaller.php: Only run core schema file if specified table doesn't already exist" 2021-06-14 16:16:48 +00:00