Commit graph

637 commits

Author SHA1 Message Date
Wandji69 3bfb7fcca1 Use ObjectCacheFactory methods
Bug: T363770
Change-Id: I5b53d72a35e2faf034e31fa560d11829337244a6
2024-06-13 09:22:12 -04:00
Umherirrender b985813c56 Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: Ia08d43b3973a12b8e0628c8552bee1c4b702f249
2024-06-10 22:36:31 +02:00
David Lynch e6e104dda5 Use reliability API to detect blocked external links
Bug: T366751
Change-Id: If3813cb662155f674688d0ca0733fabdbb338a50
2024-06-08 13:55:43 -05:00
jenkins-bot 2c7607ce94 Merge "Fix type hint in ApiVisualEditorEdit" 2024-06-04 18:44:00 +00:00
jenkins-bot 932df6759e Merge "Add type declarations and remove redundant PHPDoc tags" 2024-06-04 18:24:54 +00:00
thiemowmde 1d449787ef Add type declarations and remove redundant PHPDoc tags
Most of this code was already typed, but not everything. Using
language-level type declarations allows us to remove extra PHPDoc
blocks that just repeat the same information.

I'm also using the more narrow UserIdentity instead of User in a
few places where this is possible.

Change-Id: I7661824fcb34180af1a4fd3030fcd6c0b7d34089
2024-06-04 16:55:00 +00:00
Ed Sanders 2de778b053 Load diff modules in onTextSlotDiffRendererTablePrefix as well
onDifferenceEngineViewHeader doesn't always run.

Bug: T361775
Change-Id: I4723155f05b23e1c1e35c6f19ab209e5a2b20d74
2024-04-05 13:12:48 +01:00
jenkins-bot 16d0c4646e Merge "Preserve more error details coming from parsoid." 2024-03-28 08:25:55 +00:00
jenkins-bot ced11748fb Merge "Allow veaction=edit only when content type supports visualeditor" 2024-03-25 22:19:38 +00:00
jenkins-bot c3d1ddcddb Merge "DirectParsoidClient: don't call setOriginal directly" 2024-03-25 20:40:09 +00:00
Umherirrender b5359f08cf Allow veaction=edit only when content type supports visualeditor
The content type check gets lost by refactor of the condition in
3458d8a27e for veaction=edit.
That seems wrong as the comment says only with supported content model

Follow-Up: Ie174bc3f16bceb29cb155b9223e0acef70167fd6
Change-Id: I088f358efaa0a00a2bacbf371c80607231c79eb7
2024-03-23 01:22:17 +01:00
daniel ecb7693e1c DirectParsoidClient: don't call setOriginal directly
Pass renderId and revisionId as part of the (fake) body to
HtmlInputTransformHelper::init, instead of calling setOriginal()
directly. This avoids mis-counting these requests as not providing a
renderid in statsd.

Change-Id: I929812e571d8bd5df1c833586f3ae35d43af63cf
2024-03-19 19:13:01 +00:00
Umherirrender 11061d535b build: Upgrade mediawiki/mediawiki-codesniffer to v43.0.0
Change-Id: I3fd4f1a1eeca8d82961eef6a0fa4f1a469259b58
2024-03-12 20:51:29 +01:00
David Lynch 49d5c26c08 ve.collab: Move BetaFeature into its own file
Avoids requiring a dependency on the BetaFeatures extension.

Tell the phan config to include the BetaFeatures checkout so it'll pass
on that file, though. (Same as DiscussionTools.)

Change-Id: I258d3be59ea9cf0a798d93f0f8b1fd18a455d45a
2024-03-06 14:50:14 -06:00
Ed Sanders b3853721c8 ve.collab: Create BetaFeature
Change-Id: I36b8361f4fce8d690841e9048498bd5d52131942
2024-03-07 00:45:39 +08:00
Ed Sanders 2359b587ed ve.collab: Create ResouceLoader module
Change-Id: I2fd9d604521901e3ccdf862afc0a4f2099c533b1
2024-03-06 16:31:19 +00:00
daniel 678990cc1e Preserve more error details coming from parsoid.
HtmlOutputRendererHelper will throw HttpErrors when parsoid reports an
error. We catch these in ApiParsoidTrait, and convert them to action API
error responses. When doing so, we should preserve the additional error
data included in the HttpError.

Bug: T356157
Change-Id: I8c89468c59314069025537e6807ccbc46dbe13c6
2024-02-27 18:58:31 +01:00
thiemowmde 8825c3dce4 Fix type hint in ApiVisualEditorEdit
This doesn't make much of a difference, but I think it is more
correct. False is returned when the key cannot be found in the
cache. This is an expected situation here (hence the "try"). Null
can only be returned when null was stored in the cache before. This
can't happen here, as far as I understand the code.

Change-Id: I82f24e9f7234d0ec79f8223cd29e3df6e83f7f7b
2024-02-20 11:23:33 +01:00
jenkins-bot 8d70615b5e Merge "Enrollment for the edit check a/b test" 2024-02-19 15:27:16 +00:00
jenkins-bot d90ab2b724 Merge "Use OutputPage::setPageTitleMsg() instead of ::setPageTitle()" 2024-02-17 03:23:36 +00:00
Bartosz Dziewoński 1bed037383 Use OutputPage::setPageTitleMsg() instead of ::setPageTitle()
Bug: T343994
Change-Id: I406174f9fe3b269f65dac4a15629e12d2abd6338
2024-02-17 03:01:13 +01:00
David Lynch e7861de221 Enrollment for the edit check a/b test
The enrollment happens in ArticleTargetLoader so that the bucket will be
set for init logging.

Bug: T342930
Depends-On: I9c7c0fb52a6ec68609df6b518c7d35ddd98a95bf
Change-Id: I03c8dc8beb2eb267c052b856a30343ecab3a7657
2024-02-16 10:18:21 -06:00
James D. Forrester b72d2db4ab Replace wfGetDB() with ICP getReplicaDatabase()
Bug: T330641
Change-Id: Icdc90aa05cb56a04cf1c7f91bcfc3da5011f41a3
2024-02-14 11:05:30 -05:00
Umherirrender 4e94b88f99 Remove the VisualEditorHookRunner service
The HookRunner class is a lightweight class and not designed to be a
service, the needed HookContainer should be injected instead and a hook
runner created when needed.
The overhead from the service wiring is the same as using new objects
when needed.
This follows practice from core and the documentation in
core/docs/Hooks.md in the section "Hook runner classes"

Change-Id: Ib42281dfae8a5a260005d82ed3bb7da12e1b645e
2024-01-31 20:02:36 +01:00
jenkins-bot 2f568758de Merge "Replace confusing use of rawParams() in onSkinEditSectionLinks()" 2024-01-25 13:01:51 +00:00
Umherirrender 5ec06f50d6 Drop RL targets definitions from module class, no longer honoured
Bug: T328497
Follow-Up: I0ba090e37cef19219a2145b3c062b3a3c98f0e95
Change-Id: I3b430a4bd7d098f82b06a8d2871aeb19e729a62e
2024-01-23 21:40:20 +01:00
Bartosz Dziewoński 79d2e5a3ac Replace confusing use of rawParams() in onSkinEditSectionLinks()
This message is treated as text, and the entire result is escaped
later. rawParams() has no effect except for avoiding parsing wikitext,
so use plaintextParams() instead.

Change-Id: Ifa1f1b51546d4c24b8789b6264302a3ced81cd52
2024-01-15 22:50:54 +01:00
Jon Robson 8e97b19742 phan: Use ActionEntryPoint
Ib70e4e67e4cb1b65ac218c095864fb6eb43d0929
changed the type of the last parameter of
BeforeInitializeHook::onBeforeInitialize

Bug: T354216
Change-Id: Icd9e2a70fe001aa706b4059236b93db2eeb79369
2024-01-05 10:03:24 -08:00
Bartosz Dziewoński 0460cd834b ApiParsoidTrait: Fix converting MessageValue to Message
Despite outwardly behaving just like a Message, in fact MessageValue
stores its parameters in an incompatible way.

Bug: T352012
Change-Id: I16c64cdc8c2795536579c52a0aa21832900d96b6
2023-12-18 22:18:38 +01:00
gerritbot eae3c3c1c5 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: Ifb380012959b5b2853586cd25b0d003b53dc38eb
2023-11-29 12:41:16 +00:00
Ed Sanders 876a947a7b Move EditCheck files to ./editcheck and structure as a sub-extension
Change-Id: I4085223a93b37e601b3627fc2d6db7978cac820e
2023-11-28 15:56:43 +00:00
jenkins-bot 20fd2497cd Merge "VisualEditorEdit diffs should only compare the main slot" 2023-11-21 13:59:41 +00:00
jenkins-bot ba5c9995d0 Merge "Recognize DEFAULTSORT again" 2023-11-16 17:50:50 +00:00
David Lynch b71a34cce5 VisualEditorEdit diffs should only compare the main slot
We diff only on provided wikitext. This was causing inaccurate diffs on
pages with slotted content (e.g. File: pages on commons), which would
claim the edit would delete all the slot contents other than the
wikitext in main.

Also, remove the very old backwards compatibility params that were being
passed to getResultData in this method.

Bug: T351235
Change-Id: I135082162b96503e8d896aa4014abc9f4b936580
2023-11-16 09:18:06 -06:00
Bartosz Dziewoński d23e912884 Use expression builder instead of addQuotes()
Bug: T350992
Change-Id: Ide2edebf979a21628aa5832d6ac8774fc55310f6
2023-11-11 00:29:25 +01:00
Nardog 9b9f2c50b0 Recognize DEFAULTSORT again
Since Parsoid now treats DEFAULTSORT like any other template, we have to
scan mw:Transclusion spans.

Bug: T337398
Change-Id: Icba92fc14c1c56ec4711ba49407e8be368d57842
2023-11-09 21:26:20 +00:00
jenkins-bot 97f704f9fe Merge "ApiVisualEditor: Remove unnecessary checks" 2023-11-03 17:37:42 +00:00
Bartosz Dziewoński d80a8a6abc ApiVisualEditor: Remove unnecessary checks
According to EventLogging 'editattemptstep' data the error hasn't
happened in the last 90 days.

It probably can't happen since we switched from RESTBase to direct
Parsoid access, but keep the checks as assertions just in case.

Change-Id: I0bad1e4364c2f1b154383bc1a984c4ccc83e1700
2023-11-03 17:05:08 +01:00
Ed Sanders e238544d6e Document generated messages
Change-Id: I4467f0563a5c09ae063e13c372ebbde4f6e1d112
2023-11-03 15:39:00 +00:00
jenkins-bot 6e34b3b730 Merge "Use options-messages to delay message parsing on Special:Preferences" 2023-10-13 23:37:16 +00:00
Umherirrender 4cc8926974 Use options-messages to delay message parsing on Special:Preferences
This also removes double escaping from the messages as 'options'
for type = select gets escaped by the html form

Change-Id: I31cc19cbe1f6e61849f3ff806e53a14082e06849
2023-10-13 22:12:02 +02:00
jenkins-bot a664de74f2 Merge "Change icon for supported skins for section edit links, too" 2023-10-13 15:29:12 +00:00
jenkins-bot 0e370a84cd Merge "Remove 'VisualEditorTransitionDefault' and AutodisableVisualEditorPref.php" 2023-10-13 15:27:59 +00:00
Bartosz Dziewoński 137914de28 Change icon for supported skins for section edit links, too
Bug: T346944
Change-Id: I4653671ccb2bba2da3940897371d7dfac4bbd0f2
2023-10-09 20:13:24 +02:00
Jon Robson bc4c367bba Disable $wgVisualEditorUseSingleEditTab on mobile site
Bug: T348353
Depends-On: I92f7c2c5f4691bd511219432c53379ddd928eae2
Change-Id: I3108f884173526f95d86d975d7421b4af1cff447
2023-10-06 16:29:48 -05:00
jenkins-bot 86fb65ba90 Merge "Change icon for supported skins when both VE and source edit icons are present" 2023-10-04 23:20:19 +00:00
Jon Robson 47815e9d2b Change icon for supported skins when both VE and source edit icons are present
This introduces an extension attribute EditIconSkins which allows extensions
or skins to request the rendering of edit icons.

This will be used by Minerva in I3c9d59f49f1b939981a7b2b450448db6736d5958

Bug: T346944
Change-Id: I401805224c0f387ac85b52b50c1f298b83c03a91
2023-10-04 22:16:13 +00:00
Ed Sanders 70c116a17a Edit check: Simplify "experience" config to "maximumEditcount"
There's no product need for anything other than an upper limit
on edit count. If one arises in the future we can adjust accordingly,
but better to keep the JSON, and any UI implementation, simple
for now.

Change-Id: I892847ad78b19695f0f0f664002d3c566f7806de
2023-10-03 16:20:51 +01:00
jenkins-bot 8d40677037 Merge "Remove the BetaFeatures integration" 2023-09-21 15:29:34 +00:00
Bartosz Dziewoński dcfe952a3f ApiVisualEditor: Pass section to IntroMessageBuilder
Depends-On: I58b90d8e70d538d897d3130ead114d2522ecb703
Change-Id: I205d18b65224acef4f76fb5625bff3bbf002ece6
2023-09-19 20:14:15 +00:00