[go: up one dir, main page]

Page MenuHomePhabricator

ConfirmEdit - HCaptcha no longer working with Visual Editor in 1.38.1
Closed, ResolvedPublicBUG REPORT

Description

Hey,
since upgrade from 1.37.1 to 1.38.1 the Visual Editor get's stuck when trying to send the changes to a page, looks like this:

image.png (286×640 px, 90 KB)

Developer Console says the following:

image.png (231×1 px, 49 KB)

HCaptcha has been working fine in the prior version.

Event Timeline

Bug still in MediaWiki 1.38.2. and ConfirmEdit 1.6.0 30 jun 2022 07:26

Change 866798 had a related patch set uploaded (by Alistair3149; author: Alistair3149):

[mediawiki/extensions/ConfirmEdit@master] Use ResourceLoader callback to retrieve hCaptcha config

https://gerrit.wikimedia.org/r/866798

Change 866798 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Use ResourceLoader callback to retrieve hCaptcha config

https://gerrit.wikimedia.org/r/866798

Change 867614 had a related patch set uploaded (by Reedy; author: Alistair3149):

[mediawiki/extensions/ConfirmEdit@REL1_38] Use ResourceLoader callback to retrieve hCaptcha config

https://gerrit.wikimedia.org/r/867614

Change 867615 had a related patch set uploaded (by Reedy; author: Alistair3149):

[mediawiki/extensions/ConfirmEdit@REL1_39] Use ResourceLoader callback to retrieve hCaptcha config

https://gerrit.wikimedia.org/r/867615

Change 867615 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_39] Use ResourceLoader callback to retrieve hCaptcha config

https://gerrit.wikimedia.org/r/867615

Change 867614 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_38] Use ResourceLoader callback to retrieve hCaptcha config

https://gerrit.wikimedia.org/r/867614

After the Change 867614 javascript crashes on MW 1.38.4 with this error:

[e2b82f9bd017f414a556d7a9] /load.php?lang=en&modules=startup& TypeError: Argument 1 passed to MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks\ResourceLoaderHooks::getHCaptchaResourceLoaderConfig() must be an instance of MediaWiki\ResourceLoader\Context, instance of ResourceLoaderContext given, called in ----/includes/resourceloader/ResourceLoaderFileModule.php on line 1312

Backtrace:

from -----/ConfirmEdit/hCaptcha/includes/Hooks/ResourceLoaderHooks.php(17)
#0 ----/includes/resourceloader/ResourceLoaderFileModule.php(1312): MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks\ResourceLoaderHooks::getHCaptchaResourceLoaderConfig()
#1 ----/includes/resourceloader/ResourceLoaderFileModule.php(635): ResourceLoaderFileModule->expandPackageFiles()
#2 ----/includes/resourceloader/ResourceLoaderModule.php(908): ResourceLoaderFileModule->getDefinitionSummary()
#3 ----/includes/resourceloader/ResourceLoaderStartUpModule.php(220): ResourceLoaderModule->getVersionHash()
#4 ----/includes/resourceloader/ResourceLoaderStartUpModule.php(421): ResourceLoaderStartUpModule->getModuleRegistrations()
#5 ----/includes/resourceloader/ResourceLoaderModule.php(796): ResourceLoaderStartUpModule->getScript()
#6 ----/includes/resourceloader/ResourceLoaderModule.php(765): ResourceLoaderModule->buildContent()
#7 ----/includes/resourceloader/ResourceLoaderModule.php(905): ResourceLoaderModule->getModuleContent()
#8 ----/includes/resourceloader/ResourceLoader.php(718): ResourceLoaderModule->getVersionHash()
#9 [internal function]: ResourceLoader->{closure}()
#10 ----/includes/resourceloader/ResourceLoader.php(732): array_map()
#11 ----/includes/resourceloader/ResourceLoader.php(821): ResourceLoader->getCombinedVersion()
#12 ----/htdocs-1.38/load.php(52): ResourceLoader->respond()
#13 ----/load.php(38): wfLoadMain()
#14 {main}

[e2b82f9bd017f414a556d7a9] /load.php?lang=en&modules=startup& TypeError: Argument 1 passed to MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks\ResourceLoaderHooks::getHCaptchaResourceLoaderConfig() must be an instance of MediaWiki\ResourceLoader\Context, instance of ResourceLoaderContext given, called in ----/includes/resourceloader/ResourceLoaderFileModule.php on line 1312

I also observed this in branch REL1_38 (this patch): the first argument must be a \ResourceLoaderContext instead of a \MediaWiki\ResourceLoader\Context (it is correct from branch REL1_39, see 3e2653f83bc096889d8b69d1e01a52d7de42b247):

diff
diff --git hCaptcha/includes/Hooks/ResourceLoaderHooks.php hCaptcha/includes/Hooks/ResourceLoaderHooks.php
index a8c2b0428..ca1420c4b 100644
--- hCaptcha/includes/Hooks/ResourceLoaderHooks.php
+++ hCaptcha/includes/Hooks/ResourceLoaderHooks.php
@@ -17,3 +17,3 @@ class ResourceLoaderHooks {
        public static function getHCaptchaResourceLoaderConfig(
-               RL\Context $context,
+               \ResourceLoaderContext $context,
                Config $config
D3nnis3n claimed this task.

Confirmed fixed in MediaWiki 1.41.