Last modified: 2014-02-09 12:52:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48072, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46072 - API action=createaccount needs to interact properly with hooks (e.g. from ConfirmEdit)
API action=createaccount needs to interact properly with hooks (e.g. from Con...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.21.x
All All
: High normal with 1 vote (vote)
: ---
Assigned To: Chris Steipp
:
: 53328 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-13 16:28 UTC by Brad Jorsch
Modified: 2014-02-09 12:52 UTC (History)
14 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brad Jorsch 2013-03-13 16:28:59 UTC
action=createaccount does not interact well with ConfirmEdit: it just returns an error message "Incorrect or missing confirmation code" without actually providing any captcha information.

It needs to be determined how exactly this interaction should work; at a glance, I expect it will need changes both to the ApiCreateAccount module and to ConfirmEdit in order to work correctly, likely an "ApiBeforeCreateAccount" hook resembling the "ApiEditBeforeSave" hook in ApiEditPage.
Comment 1 Tyler Romeo 2013-03-13 16:32:34 UTC
Mhm, I ran into this problem when making the account creation API. Unfortunately, the problem is that there's just no uniform method of delivering captchas to users. Usually, it's a combination of a UI hook with an Abort* hook to make it work, but for API actions there aren't any UI hooks.

At its root, this is really a problem with MediaWiki's form handling. If there were some uniform Form class that both the API and HTMLForm used, then problems like this wouldn't be an issue.
Comment 2 Brad Jorsch 2013-03-13 16:51:38 UTC
(In reply to comment #1)
> 
> At its root, this is really a problem with MediaWiki's form handling.

The API doesn't use "form handling" of any sort, and if you're looking at some sort of "form handling" to solve this problem you're looking in the wrong direction..

As I said, you'll probably need to add an "ApiBeforeCreateAccount" hook and have ConfirmEdit use it. It will probably work much like how the "ApiEditBeforeSave" hook works, so grok that first.
Comment 3 Tyler Romeo 2013-03-13 16:59:59 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > 
> > At its root, this is really a problem with MediaWiki's form handling.
> 
> The API doesn't use "form handling" of any sort, and if you're looking at
> some
> sort of "form handling" to solve this problem you're looking in the wrong
> direction..

What do you mean? At its root, each API request is just the submission of a number of fields, which are then verified and acted upon.
Comment 4 Brad Jorsch 2013-03-13 17:31:03 UTC
I thought you were talking about something along the lines of HTMLForm but even more abstracted. Handling form submissions is already standardized, and you're using it in the API module, so it's even less clear what you're trying to get at.
Comment 5 Brion Vibber 2013-03-14 20:03:22 UTC
I'm working on this since we need it for mobile, my initial version:

* MediaWiki core: https://gerrit.wikimedia.org/r/53793
& ConfirmEdit ext: https://gerrit.wikimedia.org/r/53794
Comment 6 Andre Klapper 2013-07-25 07:52:06 UTC
Patches received -1's and need rework.
Comment 7 Liangent 2013-08-25 20:46:17 UTC
*** Bug 53328 has been marked as a duplicate of this bug. ***
Comment 8 rupert.thurner 2013-08-26 05:07:15 UTC
try to raise the priority as wlm starts soon ...
Comment 9 Andre Klapper 2013-08-26 09:14:14 UTC
Rupert: Please do not change the "Priority" field of bug reports. See http://www.mediawiki.org/wiki/Bugzilla/Fields#Priority .
Comment 10 Brion Vibber 2014-01-10 23:40:02 UTC
Reworked patches:

* core - https://gerrit.wikimedia.org/r/#/c/106844/
* ConfirmEdit - https://gerrit.wikimedia.org/r/#/c/106845/
* sample API client - https://github.com/brion/api-createaccount
Comment 11 Brion Vibber 2014-01-10 23:40:24 UTC
Assigning to Chris for review.
Comment 12 Umherirrender 2014-02-09 12:52:18 UTC
(In reply to comment #10)
> Reworked patches:

* core - https://gerrit.wikimedia.org/r/#/c/106844/
*
> ConfirmEdit - https://gerrit.wikimedia.org/r/#/c/106845/
* sample API client
> - https://github.com/brion/api-createaccount

Both patches are merged now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links