Commit graph

658 commits

Author SHA1 Message Date
Bartosz Dziewoński bf22d07d2b Fix Phan error related to showPendingTakeover()
Caused by type hints added in MediaWiki core in
I3e0df790ff9db2fa630f82408a7254a359fe61ca.

Change-Id: I45d0906c11d9e66801dfedd54e6018e90ef027c4
2024-11-14 22:38:00 +01:00
Andre Klapper 90aa7fd9cf Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: I6b296c77f8a2f6f1a146972271b1fcb3360d0cc2
2024-10-26 15:18:36 +02:00
jenkins-bot 8bab4a1b40 Merge "Replace uses of deprecated MediaWiki\Message\Converter" 2024-10-23 19:36:54 +00:00
Jon Robson f29daa890d SkinFactory::getSkinNames is deprecated, use getInstalledSkins
Bug: T377521
Change-Id: I4f66ce9929e0240e1c89f59ef781d0a378263322
2024-10-23 08:38:16 -07:00
Bartosz Dziewoński d08df5302b Replace uses of deprecated MediaWiki\Message\Converter
The converter is no longer needed now that Message and MessageValue
use the same internal format for the message parameters.

Depends-On: I625a48a6ecd3fad5c2ed76b23343a0fef91e1b83
Change-Id: I9f27d7e31be144e09ed3d0e0e858433477327b00
2024-10-21 20:52:46 +02:00
jenkins-bot 03f8d2b916 Merge "Use statslib instead of statsd in DirectParsoidClient" 2024-10-21 16:59:40 +00:00
Umherirrender 0463bec879 Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: Ic6450685433e240a4e93ce2beec381da16587b15
2024-10-20 14:01:32 +02:00
Yiannis Giannelos bfc4edbbc5 Use statslib instead of statsd in DirectParsoidClient
Depends-On: I7d4ca748c106dfd560dae31294decfb2b181e2db
Depends-On: Ib14a1ee44b81476447717bc6aa00b54de1dca995
Change-Id: I0d8eb6cacd761fa4959419b10d59046e61c714ff
2024-10-18 22:36:40 +00:00
Ebrahim Byagowi 4330014577 Avoid use of deprecated wfGetUrlUtils
Change-Id: Ica961fd161898292f0bfe33c1980329ca548c680
2024-09-08 09:55:09 +03:30
C. Scott Ananian c026712a40 Ensure page is reloaded after edit using Parsoid if appropriate
This passes the option to ApiParse which will ensure that it uses
the ArticleParserOptions hook so that the parser options used after
reload match the ones originally used to render the article.

Bug: T373212
Depends-On: I906affc8d2335b7bb48dff3a4b061fcf86b71cee
Change-Id: I18147254f1ac5f08a57e85eb2f031df7701dccef
2024-08-29 11:41:18 -04:00
James D. Forrester 6d527b9f0a Replace use of deprecated global URL functions with wfGetUrlUtils()
This is a quick fix rather than the proper DI fix.

Bug: T319340
Change-Id: Iea0d8a6b34aa4aea1c325868365d2bb65fa65eed
2024-08-28 15:10:21 -04:00
Bartosz Dziewoński 326b4a2804 Replace deprecated PermissionManager::getPermissionErrors() and friends
Change-Id: Ic217af5f9766ae2d7850597a4aec1a890d58766f
2024-08-09 13:35:29 +00:00
C. Scott Ananian 90a0a76999 Remove use of deprecated Html*Helper::init() methods
HtmlOutputRendererHelper::init() and HtmlInputTransformHelper::init()
have been deprecated.

This is a replay of Id63d93db801d0bfb3fdb4c69bf7dfeea4e68ea8f and
I8b5cd59f839446709ffd0ce1b78c1bba40195ae0, which got merged prematurely
before their Depends-On was merged.

Depends-On: I1e1213597c6be012f2bc024c2b370c968ff3b472
Change-Id: Ie762dc34523eed79bc537143394b04e64f004b53
2024-07-19 03:00:38 -04:00
Sam Wilson 3d636f1af2 Diff Renderer: load diff modules before using OOUI classes
Avoid calling OOUI\Tag->__toString() before enabling OOUI.

Bug: T360631
Change-Id: Ia05b933822ccaae32bb9d2510391f0d4bb1ea810
2024-07-03 16:59:48 +08:00
Jdlrobson 47442144d5 Revert "Remove use of deprecated HtmlOutputRendererHelper::init(..."
Revert submission 1039794-split-render-id

Reason for revert: Depends-On has not been merged yet so this
is causing CI issues.
Reverted changes: /r/q/submissionid:1039794-split-render-id

Change-Id: Iac6316cf7010b5ea92672e9ad6f09e8ee57e066b
2024-07-02 22:42:31 +00:00
Jdlrobson eb3b47be84 Revert "Remove use of deprecated HtmlInputTransformHelper::init(..."
Revert submission 1039794-split-render-id

Reason for revert: Depends-On has not been merged yet so this
is causing CI issues.
Reverted changes: /r/q/submissionid:1039794-split-render-id

Change-Id: Ifcb43e8e3dd845c146498562b398affe2936593f
2024-07-02 22:41:41 +00:00
Divec e2934f2ebb Merge changes from topic "split-render-id"
* changes:
  Remove use of deprecated HtmlInputTransformHelper::init() method
  Remove use of deprecated HtmlOutputRendererHelper::init() method
2024-07-02 18:26:30 +00:00
David Lynch 35bbc54a57 Account for SkinComponentLink class attribute possibly being an array
Bug: T367445
Change-Id: I9cb65cc157355862a4d917cac0493dce32a4baa0
2024-06-24 11:27:42 -05:00
Ed Sanders 8cb070f4d7 Remove VE user-agent based browser compatibility checks
Bug: T367735
Change-Id: I07fb1bbbd2f907672400cb9bc74fd40dea973da9
2024-06-17 13:03:04 +01:00
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
C. Scott Ananian 6bb86cbaaf Remove use of deprecated HtmlInputTransformHelper::init() method
Depends-On: I1e1213597c6be012f2bc024c2b370c968ff3b472
Change-Id: I8b5cd59f839446709ffd0ce1b78c1bba40195ae0
2024-06-07 21:40:10 +00:00
C. Scott Ananian 443e67c5c1 Remove use of deprecated HtmlOutputRendererHelper::init() method
Depends-On: I1e1213597c6be012f2bc024c2b370c968ff3b472
Change-Id: Id63d93db801d0bfb3fdb4c69bf7dfeea4e68ea8f
2024-06-05 12:22:29 -04: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