Page MenuHomePhabricator

Captcha interface is not shown to unregistered users, page save is not possible
Closed, ResolvedPublicBUG REPORT

Description

When an unregistered user attempts to add an external link (either directly or through a template transclusion), nothing changes on page submit, i.e. a click on the "Publish changes" button simply reloads the edit interface. It is not possible to proceed further unless the link or template is removed.

It seems to be caused by 0a221920ae9b9d00725a9b822d73c323f85f890b/T275710: Deprecate IContextSource::getWikiPage and IContextSource::canUseWikiPage in the ConfirmEdit extension. A Captcha is supposed to be displayed, but nothing happens on submit.

Reproduced on test.wikipedia.org. Affects 1.37.0-wmf.12.

Event Timeline

Reedy triaged this task as Unbreak Now! priority.Jul 1 2021, 3:55 PM
Reedy updated the task description. (Show Details)

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

[mediawiki/extensions/ConfirmEdit@wmf/1.37.0-wmf.12] Revert "Replace depricating method IContextSource::getWikiPage && IContextSource::canUseWikiPage"

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

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

[mediawiki/extensions/ConfirmEdit@master] Revert "Replace depricating method IContextSource::getWikiPage && IContextSource::canUseWikiPage"

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

Change 702707 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.37.0-wmf.12] Revert "Replace depricating method IContextSource::getWikiPage && IContextSource::canUseWikiPage"

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

Mentioned in SAL (#wikimedia-operations) [2021-07-01T16:23:01Z] <reedy@deploy1002> Synchronized php-1.37.0-wmf.12/extensions/ConfirmEdit/SimpleCaptcha/SimpleCaptcha.php: T285959 (duration: 01m 20s)

Change 702706 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Revert "Replace depricating method IContextSource::getWikiPage && IContextSource::canUseWikiPage"

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

Reedy claimed this task.
Reedy subscribed.

Confirmed fixed on testwiki.

Have some investigating there, so when we replace IContextSource::getWikiPage to creating new instance of page in ConfirmEdit extension ( SimpleCaptcha::confirmEditMerged ) in scope of T275710 we broke a logic of activation captcha when we add external link. We set a value to activate captcha $page->ConfirmEdit_ActivateCaptcha = true;
Then in SimpleCaptcha::showEditFormFields we check this variable ConfirmEdit_ActivateCaptcha to add captcha to output if needed. After updates to deprecate IContextSource::getWikiPage and replace it with WikiPageFactory::newFromTitle we create new instance, but used old instance here SimpleCaptcha::showEditFormFields to check the variable ConfirmEdit_ActivateCaptcha. All rules to addurl pass correctly that why we didn't received any errors and only that variable above block adding captcha form to output. The page just reload, as it expect that captcha form will be shown and user will pass captcha to save changes. Probably we can move this variable to hook handler, but better wait till T242249 will be ready so we could have edit state injected through hook handler and can set extension data there to prepare this variable ConfirmEdit_ActivateCaptcha that will be not depend on WikiPage.