Page MenuHomePhabricator

ConfirmEdit prompting for CAPTCHA breaks saving of new page from Semantic Forms
Closed, ResolvedPublic

Description

(I'm not sure if this is a Confirm Edit bug or a bug in Semantic Forms. However, if I turn off the Confirm Edit captcha things work fine, so I'll start here.)

The scenario is as follows:

  1. A uses Special:FormEdit to create a new page using the 1-step method where the field names in the form will determine the name of the page that is saved.
  1. The form contains URL fields.
  1. Upon pressing save, the URL detected prompts ConfirmEdit to require a captcha to be provided. The page is previewed properly, with the data provided from the form present.
  1. Captcha is answered properly.
  1. Page is saved with the incorrect page name, and the form contents are lost. The page will be saved with a "blank" template for the form that was used.

You can see this history on these two pages:

http://wikiapiary.com/w/index.php?title=1&curid=23615&action=history

http://wikiapiary.com/w/index.php?title=Bulbapedia&curid=23617&action=history

Note the first page was originally saved as page name "1" and the other as "2". The moves are in the history.

Also, here is the discussion around this issue on the wiki where we saw this:

http://wikiapiary.com/wiki/WikiApiary_talk:Operations/2013/March#Problems_with_Form:Website

I've worked around this by disabling the captcha for users with email confirmation, but there is some bad voodoo happening here.


Version: master
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=71408

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:31 AM
bzimport set Reference to bz46342.
bzimport added a subscriber: Unknown Object (MLST).

Can you test it again with the latest master of ConfirmEdit?

I have almost exact same problem on my Referata wiki except that after captcha the page doesn't get saved at all and just returns The specified target page ' is invalid. error.

This comment was removed by Florian.

It appears ConfirmEdit tries to initiate a WikiPage object with the NS_SPECIAL namespace.

[18e04d6f] /Special:FormEdit/Deal/Testing Exception from line 118 of includes/WikiPage.php: Invalid or virtual namespace -1 given.

Backtrace:

#0 includes/context/RequestContext.php(202): WikiPage::factory(Title)
#1 extensions/ConfirmEdit/Captcha.php(601): RequestContext->getWikiPage()
#2 extensions/ConfirmEdit/ConfirmEditHooks.php(24): SimpleCaptcha->confirmEditMerged(RequestContext, WikitextContent, Status, string, User, boolean)
#3 [internal function]: ConfirmEditHooks::confirmEditMerged(RequestContext, WikitextContent, Status, string, User, boolean)
#4 includes/Hooks.php(206): call_user_func_array(string, array)
#5 includes/GlobalFunctions.php(4013): Hooks::run(string, array, NULL)
#6 includes/EditPage.php(1380): wfRunHooks(string, array)
#7 includes/EditPage.php(1621): EditPage->runPostMergeFilters(WikitextContent, Status, User)
#8 extensions/SemanticForms/includes/SF_AutoeditAPI.php(465): EditPage->internalAttemptSave(boolean, boolean)
#9 extensions/SemanticForms/includes/SF_AutoeditAPI.php(927): SFAutoeditAPI->doStore(EditPage)
#10 extensions/SemanticForms/includes/SF_AutoeditAPI.php(116): SFAutoeditAPI->doAction()
#11 extensions/SemanticForms/specials/SF_FormEdit.php(96): SFAutoeditAPI->execute()
#12 extensions/SemanticForms/specials/SF_FormEdit.php(46): SFFormEdit::printForm(string, string, NULL)
#13 includes/specialpage/SpecialPage.php(379): SFFormEdit->execute(string)
#14 includes/specialpage/SpecialPageFactory.php(506): SpecialPage->run(string)
#15 includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
#16 includes/Wiki.php(588): MediaWiki->performRequest()
#17 includes/Wiki.php(447): MediaWiki->main()
#18 index.php(46): MediaWiki->run()
#19 {main}

Change 209637 had a related patch set uploaded (by Florianschmidtwelzow):
Don't assume, that IContextSource::getWikiPage() always returns a WikiPage object

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

This appears to fix the issue on my end.

Change 209637 merged by jenkins-bot:
Don't assume, that IContextSource::getWikiPage() always returns a WikiPage object

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