Commit graph

1579 commits

Author SHA1 Message Date
Umherirrender 2feece8bad IReadableDatabase::select cannot return false
Remove check for false from IDatabase::select as this is not possible
A DBQueryError is thrown (documented since efda8cd3 / I056b7148)

Change-Id: I465a9158aa6430e7ff8a5a83fe55c5944315aa40
2024-04-18 22:53:15 +02:00
jenkins-bot 71ec391deb Merge "Migrate to IDatabase::newInsertQueryBuilder/newUpdateQueryBuilder" 2024-04-14 18:00:20 +00:00
Umherirrender aa41e1e292 Migrate to IDatabase::newInsertQueryBuilder/newUpdateQueryBuilder
UpdateQueryBuilder does not return a value,
removed the return value from the functions as well,
deprecated since 1.33

Change-Id: I3b934a5e6d5a53c07ec5233da00d9f53ba7bae92
2024-04-13 22:51:32 +02:00
Umherirrender d2eb46e7b9 Migrate to IDatabase::newDeleteQueryBuilder
Change-Id: I516c179df464be68352809873dbff44dc3c642f1
2024-04-12 22:45:45 +02:00
Fomafix 2d9ffb7301 Inject services into NotificationDeleteJob
Change-Id: I0988e2d486eaf43cb999d38c0d2a0c81a7930cfd
2024-04-04 14:56:38 +00:00
Umherirrender b8e54d8e2c Migrate to IDatabase::newInsertQueryBuilder for upsert
Change-Id: I532b206b6c1d652369d4f986d0f5b91958a1ef47
2024-04-02 16:38:05 +02:00
Umherirrender 297ed70cb2 Replace isset() with null check in DiscussionParser
Found usage of isset() on expression self::$diffParser that appears to
be always set. isset() should only be used to suppress errors. Check
whether the expression is null instead.
See https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset

Change-Id: Iaaad420ad05b8352f8a7f162c746591749c8b3e9
2024-04-01 13:37:27 +02:00
jenkins-bot fda5f7daa6 Merge "Inject service RevisionStore into RevisionLocalCache" 2024-03-18 09:06:16 +00:00
jenkins-bot 817dd42561 Merge "Inject service LinkBatchFactory into ApiEchoMute" 2024-03-17 22:39:16 +00:00
Fomafix 5595193eb3 Inject services into TitleLocalCache
Change-Id: Ib1259484436591dd30b29651ccca474c0ce16d13
2024-03-17 21:22:00 +00:00
Fomafix 98feb3f3fd Inject service RevisionStore into RevisionLocalCache
Change-Id: I4945d582138af4500f8c6929ca0c97d05f10377e
2024-03-17 20:15:51 +00:00
Fomafix 73bd6e8ef1 Inject service LinkBatchFactory into ApiEchoMute
Change-Id: I98c1d2f6b1aa04eb64cef299a6aca475658bdd74
2024-03-17 19:13:44 +00:00
Gergő Tisza c6accbeff0 Style fixes to ApiEchoMute
Change-Id: Ic70095d44282b19fb10239c6e579acbbeccae5bd
2024-03-15 00:36:43 +00:00
Martin Urbanec 9daf86b662 Stop inserting new user_properties rows on signup
This starts using conditional user defaults, which were
already deployed to WMF production config.

Bug: T353225
Change-Id: I93c6efc40d1ef6c46d8711fc5a4161e5d8f683e3
2024-02-26 15:09:02 +00:00
jenkins-bot b0d1a454fe Merge "build: Updating dependencies" 2024-02-14 17:15:45 +00:00
James D. Forrester f20ebbd77f Replace wfGetDB() with ICP getReplicaDatabase()
Bug: T330641
Change-Id: I6a96d8b7a99f4832d5c68134fba12ad93b4da86b
2024-02-14 11:09:34 -05:00
libraryupgrader 5e30e6cda9 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* postcss: 8.4.28 → 8.4.35
  * https://github.com/advisories/GHSA-7fh5-64p2-3v2j
* semver: 5.7.1, 7.5.4 → 5.7.2, 7.5.4
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw

Change-Id: I7cb9f94d14abb512228f2a70cd1e978f849c03b5
2024-02-14 07:34:28 -05:00
Sergio Gimeno 152db8a06f Replace deprecated usage of wfGetDB
Bug: T330641
Change-Id: I863dc67e3196ea20c4f6145c5d3bb68b445b5195
2024-02-13 20:22:33 +01:00
James D. Forrester 34ffba5b03 Swap uses of Title::GAID_FOR_UPDATE for IDBAccessObject::READ_LATEST
Deprecated in MediaWiki 1.34.

Change-Id: I23732e29954d3410b22726a524c6e15b71b0d6a1
2024-01-26 13:37:47 -05:00
gerritbot ac49cd6a9f Remove indirect calls to IDBAccessObject::READ_* constants
We are getting rid of the schema of implementing this interface and
calling self::READ_* constants, it's confusing, inconsistent, prone to
clashes and isn't really useful for non-ORM systems (which we are not)

Bug: T354194
Change-Id: Ic05e9fa663ddb97fcc8290f2629d3ad89b6791a5
2024-01-26 14:00:49 +00:00
thiemowmde 9bd80c6f46 Fix EchoRevertedPresentationModel using null as string
Bug: T355751
Change-Id: I69cf14c81502dc10e333ae2536437cde043ba92b
2024-01-24 12:14:33 +01:00
Func 00f464e0fe Revert "Set a fixed default for echo-email-format"
This reverts commit f305c2d778.

Reason for revert: This is not the way of setting the default user
option, the 'default' param for HTMLForm should be filled with the
user's current option.

Similar mistakes happened many times, maybe we should deprecate setting
this param for any field types other than the 'info' type at the
preferences form level.

Bug: T350530
Change-Id: I1d0fce3db4a4228a6adcd9fe12dbc3da7ac0f710
2024-01-10 02:56:54 +08:00
Reedy 0bc5808783 Drop schema updates from MW 1.33 and 1.34
Change-Id: I9515984e294cd3910a841a07eb3239fa20040a3e
2023-12-22 01:56:23 +00:00
Martin Urbanec 1e7c1ae8e4 Hooks: Remove override for email reverted
This override is not actually overriding anything,
as we default to false for most email notifications,
including reverted. This just confused me for some time,
so removing the line to avoid that re-happening.

Bug: T353225
Change-Id: Iccd28d61c6fec860ceeb3527827089a65bf17ff8
2023-12-13 11:47:51 +01:00
Umherirrender a0ca1d89c6 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statements done manually

Change-Id: Iad87245bf8082193be72f7e482f29e9f1bad11fc
2023-12-11 16:39:00 +01:00
gerritbot 2560aa4b7f Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: Ic3e56c6e2ec606bbecbd630d8ad96d111cab24d3
2023-11-29 15:34:02 +00:00
gerritbot 51760eefcc Update UserOptionsManager's FQN
User-options related classes are being moved to
the MediaWiki\User\Options namespace in MediaWiki Core;
reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: Iddefd90b03a4751fce3f44e9fa0086082b21ae93
2023-11-29 12:55:39 +00:00
jenkins-bot 66c80eba34 Merge "Unsets icon correctly" 2023-11-13 20:51:55 +00:00
Jon Robson a3d2f9827e Unsets icon correctly
Fixes the rendering of an empty icon in Vector 2022
(empty string is a valid icon - blank icon)

Bug: T350195
Change-Id: I7b19d7e1e85eddd5a4bac29008cd53f14d640a08
2023-11-13 11:18:07 -08:00
Ed Sanders 2e6c50a963 Document some generated messages
Change-Id: I75571da5943bb94f6d997ebdb8e33fae8b62e812
2023-11-02 19:02:16 +00:00
Umherirrender e793977f23 Add some newlines to multiline statements in Hooks.php
Change-Id: I6c26dcb2dcdb345f74a14d859faa0b09fed4e0d4
2023-10-29 15:56:29 +01:00
Siddharth VP 0d071e2a7b Avoid use of globals for reading config in hooks
Change-Id: I6d476773397438d7c78e1869e2afe3699ce4c092
2023-10-29 15:41:21 +05:30
Umherirrender bdbd65ffae Replace empty() with falsy check
empty() should only be used to suppress errors
Found by a new phan plugin (T234237)

Change-Id: I3a2c86e0f83ec49cbd6af3ad30ecd0a663b761a0
2023-10-22 11:12:41 +02:00
Umherirrender ceb2da0f60 Replace empty() with falsy check
empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)

Change-Id: Ia4e25651d753b7b4d3bcd780123c66c3d90cdf1b
2023-10-21 20:56:18 +02:00
Siddharth VP 035f39d76c Use dependency injection in hooks
Removal of globals for reading config to be done in a follow-up patch

Change-Id: I8652ca67375ce2f2d79de93e0a3b75ac998131e0
2023-10-14 23:44:57 +05:30
jenkins-bot a8d425ef5b Merge "Use OutputPage::setPageTitleMsg() instead of ::setPageTitle()" 2023-09-21 21:00:58 +00:00
jenkins-bot 2a7427630f Merge "ForeignWikiRequest: Ensure fetching CSRF tokens uses unique CentralAuth tokens" 2023-09-20 15:58:11 +00:00
jenkins-bot 8114ac1c6b Merge "ForeignWikiRequest: Specify formatversion, errorformat" 2023-09-20 15:56:26 +00:00
Umherirrender 5e49d52fba Call hook handler for own hooks directly and not via hook system
Extensions should not a consumer of its own hooks,
just call the code before calling the hook.
In case of EchoGetBundleRules each extension should only handle it's
own event, so this is not a breaking change.
In case if EchoAbortEmailNotification the return false in the hook
handler already aborted further hooks, so this is not a breaking change.

Change-Id: I2715aa6499d01a1c1b3a27ff510b331eae0deca9
2023-09-08 16:47:33 +00:00
Bartosz Dziewoński 18ed307c39 ForeignWikiRequest: Ensure fetching CSRF tokens uses unique CentralAuth tokens
getCsrfToken() previously did the requests to every wiki with the same
'centralauthtoken'. Luckily this wasn't causing any bugs in practice,
because all users of ForeignWikiRequest that need CSRF tokens always
use it with a single wiki.

Change-Id: Ib1c0b9c13a34e38f85faed519c46cabd3b77e61e
2023-09-04 23:39:40 +02:00
Bartosz Dziewoński c3c3aed4dc ForeignWikiRequest: Specify formatversion, errorformat
Otherwise the parameters are copied from the local API request.
That mostly works fine, but browsing the errors logged for T342201
is a bit confusing when they're in different formats.

Change-Id: I5c361d6c0f7d635d3063290dec25f18bc6417e08
2023-09-04 23:39:30 +02:00
jenkins-bot 68d90d69a7 Merge "Make DB tests more robust" 2023-09-01 13:33:23 +00:00
jenkins-bot 697ca08827 Merge "EchoEventPresentationModel: Use userTemporary for temp accounts" 2023-08-30 10:56:01 +00:00
Sam Smith f4765cdd25 Decommission Echo* instruments
Completely remove the EchoMail and EchoInteraction instruments,
supporting code, and config variables.  Note well that the
EchoEventLoggingSchemas config included an entry for the
already-decommissioned Echo instrument so remove that too.

Bug: T344167
Change-Id: Ic0c44737d2c4a78ec19e67b8b8cd4e6cfb8e14fa
2023-08-29 11:27:15 +01:00
Daimona Eaytoy 7b1a9582b2 Make DB tests more robust
In EventMapperTest, suppress notifications created by calling
getExistingTestPage. So far, this test only worked because the existing
test page is created in addCoreDBData (and not inside the test), but
this will no longer be the case after core change
I308617427309815062d54c14f3438cab31b08a73. Clear the PageSaveComplete
hook handlers to prevent that.

DiscussionParser has a static cache of revision data that can become
stale when data is deleted between tests (because revision IDs can be
reassigned to different pages, similar to T344124). This cache seems
needed, and converting the class to a service seems hard, so add the
page title to the cache key to try and avoid collisions. This can still
break if two tests are using the same page, which is hopefully quite
unlikely.

Change-Id: Ic4cbd8ff424e1260544ff9754e0c89dd4bb2f733
2023-08-19 19:59:51 +00:00
gerritbot 84e0d10abd Replace some moved Title class uses, now MediaWiki\Title\Title
Bug: T321681
Change-Id: I19ff201e3a109d5f6b755c6c0857f7b22d08d26d
2023-08-19 16:43:18 +02:00
Amir Sarabadani 12a5a48892 Fix phpcs error
Change-Id: I6ac134c280e4e36b3935f9b095d26400ba27d2af
2023-08-19 04:53:14 +02:00
Reedy 8f44150300 And a few more namespaced classes...
Change-Id: I57b56d285bac4b41e81f656f3c1ddceee4620fb5
2023-08-18 22:27:18 +01:00
Reedy b003945c34 Namespace a few more classes
Change-Id: Ie233a4c8291432da3bd25d29337db52a2e97b540
2023-08-18 21:48:15 +01:00
Reedy e576cbdca0 Namespace some more classes
Change-Id: If1405788a4adb550e8a7e8c58b0c2c55cf10ea67
2023-08-18 21:24:59 +01:00