Commit graph

4 commits

Author SHA1 Message Date
James D. Forrester
984076f98e Add namespace to includes/api classes
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
2024-09-25 19:31:14 +00:00
Lucas Werkmeister
a3ef9bde23 Add API help messages to ApiCreateTempUserTrait
The parameters are always the same, so there’s no point in requiring
each API module to document them separately. Just reuse action=edit’s
messages everywhere. (DiscussionTools [1] and VisualEditor [2] already
do this without using the trait.)

[1]: 46a3e15dfb/includes/ApiDiscussionToolsEdit.php (491)
[2]: b224d16b64/includes/ApiVisualEditorEdit.php (608)

Bug: T357030
Change-Id: I1c8b6b48a0e0ddb4cd10a0279f8f75ba0ab5afc5
2024-02-14 12:04:39 +01:00
Thalia
645915bf0f ApiCreateTempUserTrait: Pass a default value to redirect hook
TempUserCreatedRedirectHook::onTempUserCreatedRedirect expects a
string as its $returnTo argument. ApiCreateTempUserTrait passes
whatever the 'returnto' param is set to; however, this may be
null if not set.

Rather than require APIs that use the trait to set the 'returnto'
param, pass an empty string instead of null if not set.

Bug: T349223
Change-Id: I4fd445df67a63c5e357a3693e7f71519e5ebdd25
2023-11-06 13:03:34 +00:00
Thalia
9396cd6eed Add ApiCreateTempUserTrait for APIs that create temporary users
Refactor EditPage's logic for getting a redirect URL into a trait
that can be shared between classes that exteend ApiBase.

Bug: T349223
Change-Id: I7cafa0bfc17a75d44e1d83b9561b4b2778b5f132
2023-11-01 13:29:02 +00:00