Commit graph

1515 commits

Author SHA1 Message Date
jenkins-bot 7bfdebfa0b Merge "Add PLURAL support for "mark all as read" buttons" 2023-05-20 15:39:10 +00:00
jenkins-bot fbaa93f3bd Merge "Update moved class FauxRequest" 2023-05-19 14:38:13 +00:00
gerritbot 68b06cac10 Update moved class RawMessage
See T321882. Moved in I195cf4c67bd514

Bug: T321681
Change-Id: I6ca53fd2b8f3523ea5e29a9119d96da51e0a55a5
2023-05-19 10:30:54 +00:00
gerritbot f3da9368e8 Update moved class FauxRequest
See T321882. Moved in I832b133aaf61ee

Bug: T321681
Change-Id: Ie2e1ff04178e3f502f90336e68ab012636b46fb5
2023-05-19 10:24:07 +00:00
Kosta Harlan 61a656ac27
LinksUpdate: Don't send page-linked notifications for pages created by bot users
Follows-up: I704a2912e0a8b0e996d4e4e0a73f4ed3b9ccf6be
Bug: T318523
Change-Id: I32edf044b858956d030d318994d799071cde521b
2023-05-16 14:54:58 +02:00
Umherirrender ed5cabcb0e Replace deprecated Hooks::run
Bug: T335536
Change-Id: Ic7f758fc4f65e364aa23b218e5e62a47f1641d8e
2023-05-07 03:01:29 +02:00
Umherirrender 159863d15a Replace deprecated Hooks::run
Bug: T335536
Change-Id: I3f20828047a886e1140fa080e3f3f1945397424f
2023-05-06 19:59:22 +00:00
Jon Harald Søby 60748b0b25 Add PLURAL support for "mark all as read" buttons
Pass a relevant number of unread notifications to the messages
'echo-mark-all-as-read' and 'echo-mark-wiki-as-read' each time
they are used, in order to facilitate the use of PLURAL in
the messages. This allows translators to say e.g. "mark both as
read" when there are two unread notifications, for instance.

Bug: T321462
Change-Id: Ida65be2d7f2663d9802f71c7ea1eb588db8cd254
2023-04-29 01:31:14 +02:00
Kosta Harlan 53efddc825
Don't send page-linked notifications for pages created by bot users
Bug: T318523
Change-Id: I704a2912e0a8b0e996d4e4e0a73f4ed3b9ccf6be
2023-04-28 12:13:04 +02:00
gerritbot fd6bdf95af Update moved class WikiMap
See T321882. Moved in I60cf4b9ef02b9d5

Bug: T321681
Change-Id: Icf209fddd9367540352d935557881d7e6e5a1e4c
2023-04-25 09:53:21 +00:00
gerritbot 7ab2ea01a1 Update moved class TitleFactory
See T321882
Moved in Iac1688172ee457

Bug: T321681
Change-Id: I8c171d4cb1413d2acd20016f85220e9a33a006da
2023-04-19 16:55:32 +00:00
jenkins-bot 96f5ec469c Merge "Use foreach ( $array as $key => $value )" 2023-04-08 21:22:35 +00:00
Fomafix 2862711ad2 Use foreach ( $array as $key => $value )
Use

  foreach ( $array as $key => $value ) {

instead of

  foreach ( array_keys( $array ) as $key ) {
      $value = $array[$key];

Change-Id: I3a75d3c7a2b41888998af37701ed9075380d286a
2023-04-07 11:58:33 +00:00
Fomafix 940a548caf Avoid tabs in comment blocks
Change-Id: I4a2d0afa229f095dbe8bcb919d832e701c2e447a
2023-04-07 11:57:46 +00:00
jenkins-bot 3619a49d65 Merge "DiscussionParser: Clarify business rules comment" 2023-03-31 12:14:48 +00:00
jenkins-bot a0eee370cf Merge "Add notification type for user page edits" 2023-03-31 09:41:35 +00:00
Kosta Harlan 1da878b9fb
DiscussionParser: Clarify business rules comment
Follows-Up: Ibe0092a96d96f6fa9d93991418b723f3e70e1b75
Change-Id: Iae5dcc709280ce90efd15886f9874347a11caa4a
2023-03-31 11:21:48 +02:00
Ed Sanders 91869f5708
Add notification type for user page edits
Creates a notification type to notify users when their
user page is edited.

Co-authored-by: Kunal Mehta <legoktm@debian.org>
Co-authored-by: Ed Sanders <esanders@wikimedia.org>
Bug: T3876
Change-Id: Ibe0092a96d96f6fa9d93991418b723f3e70e1b75
2023-03-31 11:21:48 +02:00
jenkins-bot a08e5287ec Merge "List "Notifications" under "Account management" on Special:SpecialPages" 2023-03-28 11:06:21 +00:00
Bartosz Dziewoński 47fb0fdaed List "Notifications" under "Account management" on Special:SpecialPages
Bug: T333242
Depends-On: Ieba1631ca3c0562b784aa07d2b26c418448e70a1
Change-Id: Ibcc6b4b6bc618ee6b98e9d8784f079d356f65a37
2023-03-27 21:39:15 +00:00
jenkins-bot a255135164 Merge "Make page linked notification link to diff" 2023-03-27 14:05:41 +00:00
Gergő Tisza 79ee292ca4
Fix logging of cross-wiki API errors
Error messages included a non-existent 'code' parameter; use the
curl error message instead. Also log the error status (which is
there somewhere in 'response' but logstash doesn't manipulate JSON
fields well).

Bug: T328128
Change-Id: If295d7a3b397b22301986a226a54df908c2ccf4d
2023-03-19 16:48:10 -07:00
jenkins-bot aabbc36d1e Merge "Hooks: Check if user is still registered" 2023-01-26 10:33:29 +00:00
Kosta Harlan 77fce1c31b
Hooks: Check if user is still registered
In certain circumstances, it's possible for the user account to
have been deleted by the time the deferred update runs.

Bug: T318081
Change-Id: I3d1b5d1f034bf239e25d4af484b6329582b49bdc
2023-01-25 22:36:55 -08:00
jenkins-bot 87c5ed22b5 Merge "Change edit count thanks notification link to diff" 2023-01-26 01:55:56 +00:00
lectrician1 53c38fe3df Change edit count thanks notification link to diff
It would be nice for editors to be able to see the particular edit
that was their 100th, 1000th, etc. This patch changes the link of the
edit count thanks notification to the diff of the edit, rather than the
page the edit was on.
Note that this link will only work for newly created notfications. Past
edit count notification database entries do not store what revision id
the edit was on in the 'echo_events' table, so there is no way to link
to them unless the table is updated.

Bug: T326998
Change-Id: If81fd71ce6f99ad3883a3bfbfbd798270f762d37
2023-01-14 03:47:42 +00:00
jenkins-bot db7220c894 Merge "Simplify in-array search in DiscussionParser" 2023-01-13 21:33:19 +00:00
thiemowmde fdc0eb2bbc Simplify in-array search in DiscussionParser
Instead of turning the array keys into an array of strings and
searching that we can access the original array by key.

Change-Id: Id4fddd242cff66ee70fa1cc07cdcb6938482696c
2023-01-13 21:53:20 +01:00
Aaron Schulz c408c0ffa8 Remove MWEchoDBFactory::waitForReplicas()
Switch the callers to the standard Maintenance::waitForReplication() method.

Avoid using LoadBalancer::waitFor(), which will made internal soon.

Bug: T326274
Change-Id: Idf0562eb33d90ff70eb3a7d5d7f54da944423d27
2023-01-05 13:14:56 -08:00
Umherirrender 039e2d2962 Replace deprecated Language::factory
Bug: T325986
Change-Id: Ibeb4af25184dc09a735f4f67457ab72a4139c25d
2022-12-28 20:19:01 +01:00
Umherirrender eceeb0531b Replace deprecated Language::fetchLanguageName
Bug: T325962
Change-Id: If7b71ee955de8018e2f1bc265d0391744c81faf0
2022-12-27 17:17:34 +01:00
lectrician1 06d7a488fd Make page linked notification link to diff
This changes the page linked notification to link to the diff of when
the page was changed and removes the "View changes" button.

Bug: T324849
Change-Id: I25a3de3ce5c02be3abbab1d2d2dd1aad8d287cbd
2022-12-24 18:20:01 +00:00
jenkins-bot b2fa09c702 Merge "schema: Run cleanup updates for echo_push_subscription separately" 2022-12-20 09:34:50 +00:00
jenkins-bot d294a4ee9f Merge "Avoid unnecessary User instantiation" 2022-12-16 20:13:12 +00:00
Matěj Suchánek 8a8e3badfd Avoid unnecessary User instantiation
Change-Id: I224c8d4bff3cc90260b9f44e321cf4738f80a1b5
2022-12-16 19:05:35 +01:00
Umherirrender af15ecbc29 Replace deprecated Linker::formatComment/formatLinksInComment
Bug: T324906
Change-Id: I8cd6ce852156d8c2c9e0da6218a62a2befe40ef3
2022-12-11 01:54:36 +01:00
Umherirrender fcc46964c1 schema: Run cleanup updates for echo_push_subscription separately
The addition of the foreign key echo_push_subscription_ibfk_2
in 4abfbd3 did not affected already existing installs,
because the updater part was missing.
The addition of a foreign key also creates an index under mysql,
which is also not part of older installs and needs to be created.
Also the new field eps_topic from c188dac is missing and now added.
The new index echo_push_subscription_token from 3513c64 is added.

The drop patch set d35c502 assumes that the foreign key exists,
now every step of the update is running separately to avoid one failing
update to skip the remaing update steps.
This avoid issues on wikis installed before REL1_35 and updated with the
patches from REL1_36

Bug: T322143
Change-Id: I0759b82ad91849880c784e412e04dd53f26df6a2
2022-12-09 20:36:32 +01:00
Bartosz Dziewoński e9447a8786 Fix no-JS Special:Notifications only displaying one notification per day
The loop accidentally overwrote the whole array in every iteration.
It's not necessary to define these empty arrays at all: when working
with multi-dimensional arrays, PHP will create them as needed.

Follow-up to 4835b6b1cb.

Bug: T323491
Change-Id: I5043efc31722d2b9cd2a8dd482594355a761008e
2022-11-21 13:10:12 +00:00
jenkins-bot 35d89af670 Merge "Initialize Echo when CentralAuth autologin replaces the user toolbar" 2022-11-21 09:02:02 +00:00
Gergő Tisza b69a2cf57f
Initialize Echo when CentralAuth autologin replaces the user toolbar
Bug: T55134
Change-Id: I2699e84080c907c491b1becdc485fd176f3b2bca
2022-11-19 23:28:23 -08:00
jenkins-bot bd0f5fda49 Merge "Fix and disable some phpcs exclusions" 2022-11-18 18:23:38 +00:00
Bartosz Dziewoński 3ddc5c201d Use buildComparison() instead of raw SQL
Bug: T321422
Change-Id: If9ad9268d3bd7d62c3b4af4274d3d579cdd47db3
2022-11-15 12:06:04 +01:00
Reedy a101ce674c Fix and disable some phpcs exclusions
Change-Id: I2ecaf71c8836d627f20629d667b78ffbf420e4ee
2022-11-12 17:58:13 +00:00
Reedy 5611662f06 Namespace Model
Depends-On: Id28792658de950b99a8786f881563476def59eba
Change-Id: Ib57ea2db947285946f31fa9912b37181044df9d3
2022-11-10 14:25:42 -07:00
Reedy 69139e663e Forward Event namespacing
Change-Id: Iddb4a5d4057f9c6ed00f754d2e3cd79cd873f212
2022-11-10 14:24:42 -07:00
Reedy 310128fa28 NotificationServiceClient: Don't call Message::serialize() directly
Change-Id: I9cfe98376dcce5233afb7571ea1fc26b29dd3e48
2022-11-10 14:24:11 -07:00
thiemowmde cfa424f16b Make use of the ?? and ??= operators where it makes sense
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.

Change-Id: If4145c48eb374aa8e5deeb38aecb27c6c8905382
2022-11-09 14:40:52 +01:00
jenkins-bot ef5f45d3bd Merge "Use short array destructuring instead of list()" 2022-11-09 13:04:45 +00:00
thiemowmde 9ab1d92c9c Fix PHP 8.1 compatibility issue in ForeignNotifications
Passing null to functions that expect a string is no longer allowed.
Here in this code it can apparently only happen in test scenarios.
That's why I use a very minimal workround that still calls the same
code. The lookup will return an empty string and trigger the expected
code path below.

Bug: T311448
Change-Id: If04924a22b82ae29b8f9327668e8965d6d2a490d
2022-11-08 20:56:48 +01:00
Fomafix 096e4a709f Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

Change-Id: I395e791aed6cc99b7ce1273f51c292e29360443a
2022-11-08 16:41:24 +00:00