Last modified: 2012-07-02 17:57:31 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 T39995, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37995 - EditPage::userNotLoggedInPage should have an optional "message" argument
EditPage::userNotLoggedInPage should have an optional "message" argument
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 18:43 UTC by Mark Holmquist
Modified: 2012-07-02 17:57 UTC (History)
1 user (show)

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


Attachments

Description Mark Holmquist 2012-06-27 18:43:56 UTC
EditPage::userNotLoggedInPage is a very helpful thing for me. I need to make sure a user is logged in, conditionally, and this function lets me do it.

However, the reason they're presented with an error _isn't_ because they need to be logged in to edit--they could plain old edit if they weren't logged in, so long as the site allows it. But they can't use _my extension_ without logging in.

So, I'd like to have the chance to pass in a custom error message, or message key (I have them all in .i18n.php anyway), so the user can see the proper message.

Failing that, a point towards a different method that allows this, and has the same functionality as userNotLoggedInPage().

Thanks!
Comment 1 Alexandre Emsenhuber [IAlex] 2012-06-29 19:04:59 UTC
That method is deprecated since 1.19, its functionality is now in OutputPage::showPermissionsErrorPage().

Since 1.20 you also have an UserNotLoggedIn exception that you can use with our own message.
Comment 2 Mark Holmquist 2012-07-02 17:57:31 UTC
Thanks, Alexandre! I'm now properly using the exception. If only I'd had your searching-fu available at the time :)

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


Navigation
Links