Page MenuHomePhabricator

Removing ConfirmEdit class aliases breaks $wgCaptchaClass
Closed, ResolvedPublic

Description

Removing ConfirmEdit class aliases (rECOEa8019493007e: Remove class_alias calls and cleanup Autoloads / https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ConfirmEdit/+/1082578) requires updates to $wgCaptchaClass, otherwise the wiki crashes with errors like Error: Class "FancyCaptcha" not found.

If this is an intended backwards-compatibility breakage, then it needs to be in RELEASE-NOTES, and the documentation using old class names at https://www.mediawiki.org/wiki/Extension:ConfirmEdit needs to be updated.

If it is not intended, then there needs to be some back-compat code for the old $wgCaptchaClass values in Hooks::getInstance().

Event Timeline

MSantos subscribed.

Today is the last day before the train rides for 1.44.0-wmf.28 [1] and the alpha branch release [2] will soon be announced.

I'm flagging this task as a non-blocker, but if that's not right, please make sure this is resolved and backported before the release is complete in few weeks.

https://www.mediawiki.org/wiki/MediaWiki_1.44/wmf.28
https://www.mediawiki.org/wiki/MediaWiki_1.44/Roadmap

I think it is a blocker. I will just restore the aliases, and leave it for whoever wants to remove them to figure out how to communicate the breaking change.

Change #1143692 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/ConfirmEdit@master] Restore class_alias calls for CAPTCHA classes

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

Change #1143692 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Restore class_alias calls for CAPTCHA classes

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

Change #1146003 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/ConfirmEdit@REL1_44] Restore class_alias calls for CAPTCHA classes

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

Change #1146003 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_44] Restore class_alias calls for CAPTCHA classes

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

matmarex claimed this task.

Change #1148879 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/ConfirmEdit@master] Allow $wgCaptchaClass to be set to a built-in module by name

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

Change #1148879 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Allow $wgCaptchaClass to be set to a built-in module by name

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

Change #1151806 had a related patch set uploaded (by Reedy; author: Krinkle):

[mediawiki/extensions/ConfirmEdit@REL1_44] Allow $wgCaptchaClass to be set to a built-in module by name

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

Change #1151807 had a related patch set uploaded (by Reedy; author: Krinkle):

[mediawiki/extensions/ConfirmEdit@REL1_43] Allow $wgCaptchaClass to be set to a built-in module by name

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

Change #1151807 abandoned by Reedy:

[mediawiki/extensions/ConfirmEdit@REL1_43] Allow $wgCaptchaClass to be set to a built-in module by name

Reason:

Not actually needed

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

Change #1151806 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_44] Allow $wgCaptchaClass to be set to a built-in module by name

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

Change #1151807 restored by Reedy:

[mediawiki/extensions/ConfirmEdit@REL1_43] Allow $wgCaptchaClass to be set to a built-in module by name

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

Change #1151807 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@REL1_43] Allow $wgCaptchaClass to be set to a built-in module by name

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

I am on this commit: https://gerrit.wikimedia.org/g/mediawiki/extensions/ConfirmEdit.git/+/7b18b336e31b7b72a12887bc2418550499459d26

However, I still got the Error: Class "ReCaptchaNoCaptcha" not found error. Only switching to $wgCaptchaClass = 'MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\ReCaptchaNoCaptcha'; made things work for me.

Note, I just migrated to QuestyCapcha and here configuration with just specifying the class name $wgCaptchaClass = 'QuestyCapcha'; works, i.e., it looks like something went wrong for ReCaptchaNoCaptcha.

That commit is in REL1_43, and is a couple of weeks after rECOE39479e347365: Allow $wgCaptchaClass to be set to a built-in module by name..

What's the full error/stack trace?

You have got the wfLoadExtension( 'ConfirmEdit/ReCaptchaNoCaptcha' ); entry too, right?

Regrettably, I cannot provide the stack trace. It was something like a 10 liner.

This was my configuration, unchanged for a couple of years.

## Confirm Edit
wfLoadExtensions( [
    'ConfirmEdit',
    'ConfirmEdit/ReCaptchaNoCaptcha'
    ]
);
$wgCaptchaClass = 'ReCaptchaNoCaptcha';
$wgReCaptchaPublicKey = '***';
$wgReCaptchaPrivateKey = '***';

It was the last wiki I took care of, which was using the captcha module.

I do not want to spoil the party after starting it myself. The above configuration results into:

Issue:

[0659e3c16216223e75181602] /wiki/Spezial:Benutzerkonto_beantragen Error: Class "ReCaptchaNoCaptcha" not found

Backtrace:

from /../w/extensions/ConfirmAccount/includes/frontend/specialpages/actions/RequestAccount_body.php(262)
#0 /../w/extensions/ConfirmAccount/includes/frontend/specialpages/actions/RequestAccount_body.php(99): RequestAccountPage->showForm()
#1 /../w/includes/specialpage/SpecialPage.php(728): RequestAccountPage->execute()
#2 /../w/includes/specialpage/SpecialPageFactory.php(1717): MediaWiki\SpecialPage\SpecialPage->run()
#3 /../w/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#4 /../w/includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest()
#5 /../w/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#6 /../w/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#7 {main}

(@Kghbln's error seems similar to T398850: Class "ReCaptchaNoCaptcha" not found; I've commented over there with what I think the root cause here might be)

And that's why I asked for the stack trace.. The error isn't in ConfirmEdit, it's in ConfirmAccount