Commit graph

968 commits

Author SHA1 Message Date
Umherirrender 1a8ee0f3d1 Call IDatabase::insertId only when a row was inserted
As docs says on IDatabase::insertId

Change-Id: I4a61ce625c4f31316bb9eee83f293a438bac2e0e
2023-08-16 20:54:09 +02:00
jenkins-bot ca800cf631 Merge "Use UpdateQueryBuilder and InsertQueryBuilder" 2023-08-16 18:50:19 +00:00
jenkins-bot d28b11383e Merge "Make ApiDiscussionToolsEdit non-internal, add 'tags'" 2023-08-16 17:00:37 +00:00
Martin Urbanec 16ac49fe61 Make ApiDiscussionToolsEdit non-internal, add 'tags'
What:
Growth wants to use ApiDiscussionToolsEdit to
post questions on behalf of new users (to make use
of the auto-subscribing logic DiscussionTools has).

This seems like a good moment to make the API
non-internal.

What:
* Add support for 'tags' parameter
  (this doesn't actually work w/o the depends-on)
* Add autosubscribe parameter to give more control
  to callers over whether autosubscription is used.
* Remove isInternal()

Bug: T343339
Bug: T333632
Depends-On: I0ac60ca8473fe28461b2da60f9911baac4994388
Change-Id: I39727de40557d2494f4d60bf224490caaedfdee1
2023-08-16 16:52:38 +00:00
jenkins-bot a7b703c589 Merge "Use HookHandlers for BetaFeatures hook" 2023-08-16 08:51:41 +00:00
jenkins-bot de9ad429ee Merge "Use HookHandlers for Echo hook" 2023-08-16 05:26:09 +00:00
Umherirrender e5cbc838a8 Use HookHandlers for BetaFeatures hook
Bug: T273303
Change-Id: I685eb618b7ca2dc5b10bc5f08bfd235f682ff3c5
2023-08-16 05:23:25 +00:00
Umherirrender 3515751592 Use HookHandlers for Echo hook
Bug: T273303
Depends-On: Iffa2b409502b4269c9746e0304feb4aaee37a86e
Change-Id: I489a37b7b377b874ab3384bdc071e9c63701345a
2023-08-16 00:39:43 +02:00
jenkins-bot a6ffd38185 Merge "Remove 'internal' flag from ApiDiscussionToolsSubscribe/GetSubscriptions" 2023-08-15 16:03:24 +00:00
jenkins-bot b52bff0257 Merge "Handle Parsoid resource limit exceeded exceptions" 2023-08-14 13:33:49 +00:00
C. Scott Ananian 0de3f468c3 Remove unnecessary use of Parser
Change-Id: Ib86ed6300ae85d7d69557a11bbd8f7b409e11d6c
2023-08-12 00:23:49 +02:00
Arlo Breault 3d9585acbe Handle Parsoid resource limit exceeded exceptions
Parsoid can be expected to throw limit exceeded exceptions so a more
graceful response should be provided.

Bug: T325298
Change-Id: I6bedc7639a68311d5247331d5e53f88c004ebc5e
2023-08-11 18:06:26 -04:00
Bartosz Dziewoński 505aef8a60 Use UpdateQueryBuilder and InsertQueryBuilder
Change-Id: I8d8377a0ad3472d193b1bf9b20c8966bb6b34dd7
2023-08-11 21:59:03 +02:00
Ed Sanders db53ae0a48 Remove 'internal' flag from ApiDiscussionToolsSubscribe/GetSubscriptions
Bug: T329474
Change-Id: Ie8e745fc83a320134d3790012311c4b35c7f3934
2023-08-07 15:14:58 +01:00
Bartosz Dziewoński a783b9371f ThreadItemStore: Ignore duplicates caused by duplicate executions
For some unknown reason our updates are being processed more than once
at the same time. Ignore or work around the "duplicate entry" errors
caused by that.

Bug: T323080
Bug: T341811
Change-Id: Iaae1dc2d5ed5bf4ac6760fb1d39dc21f2af89e9a
2023-08-04 18:56:36 +00:00
Bartosz Dziewoński 66b1ca1578 ApiDiscussionToolsPreview: Add missing documentation messages
Bug: T342634
Change-Id: If550d6ccf6fb8256d2f252d796f8bc4651dc8f7b
2023-08-04 20:55:13 +02:00
jenkins-bot f86bd42f01 Merge "Enable automatic topic subscriptions for autocreate accounts" 2023-08-01 16:38:27 +00:00
Ed Sanders eb8a689069 Enable automatic topic subscriptions for autocreate accounts
Bug: T332618
Change-Id: I0a9ed795b7a28365bca199a2db44217e53063002
2023-07-31 13:39:46 +01:00
Ed Sanders e389fc48f1 Always use === in PHP
Change-Id: I30ca7cdf73921dcae48997841816099972cdbed0
2023-07-26 14:29:40 +01:00
jenkins-bot 5bf0110b4b Merge "Replace uses of UserNameUtils::isTemp with UserIdentityUtils::isTemp" 2023-07-26 12:54:48 +00:00
jenkins-bot e0763d81ed Merge "Use strict comparison with array_search" 2023-07-26 12:09:21 +00:00
Thalia ec8048131d Replace uses of UserNameUtils::isTemp with UserIdentityUtils::isTemp
Where a UserIdentity is available, use UserIdentityUtils, which has
fewer dependencies.

Change-Id: I035bfbc7801f4ac77a8c6f0991f0fdf71b8fb429
2023-07-26 11:32:27 +01:00
Ed Sanders 1bb29faa58 Use strict comparison with array_search
Change-Id: Id920d49701bd9436a6247763ed40df052877ad2f
2023-07-24 18:50:00 +01:00
Bartosz Dziewoński 1b80b1ffcf ThreadItemStore: Look harder for invisible rows
This reverts 08e1073f58 (T322701),
which does not work, and instead uses the same solution as
4439e934429617cc77f34cc9c783f0b52a06c920 (T247553).

Bug: T339882
Change-Id: I1b6772b1cdfd0d7e1c603333a2e43152d3591c38
2023-07-16 00:45:52 +02:00
jenkins-bot 218d3aea38 Merge "Backend changes related to topic subjects in message body" 2023-07-11 15:21:50 +00:00
jenkins-bot 7b147cffbf Merge "ApiDiscussionToolsPageInfo: Allow excluding signatures" 2023-07-11 15:17:02 +00:00
jenkins-bot 5b2d1046ad Merge "Reload page or redirect when saving an edit creates a temp account" 2023-07-11 15:16:59 +00:00
jenkins-bot ce286af8dc Merge "Suppress the empty state in previews again" 2023-07-11 13:59:49 +00:00
Bartosz Dziewoński 90f8fe5ec1 Reload page or redirect when saving an edit creates a temp account
Depends-On: I6cdc014fb39d35ce1f091b53dc3a9c4a3c95f9e9
Depends-On: I01e13ce1ebab462eeb0ba3847d4205a88965a127
Bug: T338002
Change-Id: I768e4fa2030d781bbc65428371bda17a87bd6a42
2023-07-10 22:55:58 +00:00
jenkins-bot cb700abb8c Merge "SpecialFindComment: Allow spaces instead of underscores in the input" 2023-06-24 10:40:20 +00:00
Bartosz Dziewoński 80746017bb SpecialFindComment: Allow spaces instead of underscores in the input
Our IDs and names are correctly written with underscores, but allow
spaces too for consistency with the behavior of internal wiki links
when linking to a subpage of Special:FindComment.

Change-Id: Ib9f67ac02d963395db9d56951946b9747a410a88
2023-06-24 10:47:48 +02:00
jenkins-bot 6de3603990 Merge "ApiDiscussionToolsEdit: Allow not returning the new revision content" 2023-06-22 21:31:32 +00:00
Bartosz Dziewoński 14d9652a78 Backend changes related to topic subjects in message body
Our edit API now recognizes topic subjects in the message body,
generates edit summaries from them, and optionally returns an error
if no subject is provided.

Bug: T334163
Bug: T338390
Change-Id: Iac3778a4a88a4def234be9d10b80d9796d35bceb
2023-06-22 10:35:04 +02:00
Bartosz Dziewoński aa239a1ad1 Suppress the empty state in previews again
It wasn't appearing in normal previews thanks to some redundant checks
elsewhere, but it was appearing in our own internal previews using
ApiDiscussionToolsTrait::previewMessage(). It wasn't causing any
problems until change Iac3778a4a88a4def234be9d10b80d9796d35bceb, which
detects headings in the preview, and it was detecting the empty state
heading.

Follow-up to commits 8fb467896f and
ab40ef62c0, where I replaced a HTML
comment with ParserOutput extension data to indicate this, and then
accidentally removed the cleanup code from removeInteractiveTools()
with no replacement.

Change-Id: I4b650f82c711d65e200758e981ce338202deeaa6
2023-06-22 10:31:29 +02:00
jenkins-bot 0c7c7de242 Merge "Support ISO 8601 timestamps in the parser" 2023-06-19 12:31:58 +00:00
Theodore Dubois 4ca17b8c33 Support ISO 8601 timestamps in the parser
https://wikipesija.org is currently using ISO 8601 as the default date
format. The format is xnY-xnm-xnd"T"xnH:xni:xns and 'xn', 'm', and 's'
need support added.

Change-Id: I235098a578eb92ddd23ea47fa23d60df4b28f590
2023-06-17 11:36:43 -07:00
Bartosz Dziewoński b405fd9b40 Make topic subscriptions unavailable to temp users
Bug: T332432
Change-Id: Icf91f0900ef3435cf3e9eedcf983e61ad9aeea69
2023-06-13 01:05:55 +02:00
Bartosz Dziewoński 6bf6105d2a ApiDiscussionToolsEdit: Allow not returning the new revision content
Sometimes we call this API and then reload the page (or navigate to
another URL), without using the page content it returns. Save some
work and some data transfer and don't generate it in those cases.

Depends-On: Ic5fac61f3ef9b2dfce6ff757f1d414a9f41f217d
Change-Id: If1aea90488e3f22cc31ac1f360139ae65acf000a
2023-06-12 20:28:45 +00:00
jenkins-bot b6ebb59c5f Merge "EchoHooks: Use symbols instead of string class names" 2023-06-09 20:59:21 +00:00
Ed Sanders 531ced9e31 EchoHooks: Use symbols instead of string class names
Change-Id: I3a4bba84d939f23653b719a271cecaa9395f0cd0
2023-06-09 22:33:27 +02:00
thiemowmde 0cf68818a8 Add various, more specific type hints
* Add @var comments to untyped getService() calls so IDEs and tools
  are able to understand where the callers are.
* Use the more specific IReadableDatabase where possible.
* Fix missing import.

Change-Id: I9c1153cb9fe872227753628a947f40bd5ee447fa
2023-06-09 13:44:42 +02:00
jenkins-bot f9580e6817 Merge "Use namespaced Echo classes" 2023-06-08 13:25:14 +00:00
Siddharth VP 03fcb20810 Use namespaced Echo classes
Change-Id: Id1673cb6ec0ae5f9177db28414d46d216fcabb45
2023-06-08 13:46:31 +05:30
Ed Sanders 0672f4c74a Remove DiscussionToolsEnableMobile
This existed to do a staged rollout to WMF wikis.

Bug: T322497
Change-Id: I4562c166f3f07bce972f9d599de211147d2dc631
2023-06-06 13:25:21 +01:00
Ed Sanders 99f132f05e Remove most DiscussionTools feature configs
Only visual enhancements are yet to be made available everywhere.

Bug: T322497
Change-Id: Ia8a7673f23d1ee31bb7e53d8e75f982d1e48d1ec
2023-06-06 13:25:19 +01:00
Ed Sanders 3b4673bfad Drop the DiscussionToolsEnable feature flag
This existed to do a staged rollout to WMF wikis, which was
finished in March 2021 (T276497).

Bug: T322497
Change-Id: I8851f0243e6920d93f3eb1870d1604bf201ed5a4
2023-06-06 13:08:35 +01:00
Ed Sanders dda86f8ebf Always use the strict equality flag when using in_array
Change-Id: Ia09f5aadc3bbf64645ba174f047e53db49e07925
2023-06-06 13:08:00 +01:00
jenkins-bot a1d0e3a9d3 Merge "Create HookRunner class and the hook handler interface" 2023-06-05 22:12:23 +00:00
Umherirrender 378769a974 Create HookRunner class and the hook handler interface
Bug: T273303
Change-Id: I6d00848f07fc7d17f3dc7f44b7b6b61553219558
2023-06-04 20:12:56 +02:00
Bartosz Dziewoński e65b49ec43 Don't try to set preferences for temporary accounts
Bug: T337784
Change-Id: I34d35673e5d2651e1da10ba0e7946a0bd54312ea
2023-06-02 20:11:52 +02:00