Topic on Manual talk:UploadStash

UploadStashNotLoggedInException

5
TespSam (talkcontribs)

Hi there, I've got the moderation extension and the auth_remote user extension set up on my dev wiki.  Wiki version 1.30, moderation version 1.1.18, auth remote user version 2.0.0.  It's a whole mess of snakes in here, man.  Visual editor doesn't work because parsoid doesn't like remote authorizations yet and so I'm using mediawiki's wikieditor toolbar which pops up the same dialog as visualeditor when you want to upload an image.  I've hacked and chopped at the uploadstash.php script and I've finally gotten it to accept an upload, but it still doesn't recognize my user session. The file goes to moderation as if I was anon, instead of getting approved.  Problem is, the dialog says 'Something went wrong' and goes on to say that the file has been submitted for moderation in the same style that it would if it had thrown an exception.  The dialog thinks that the upload has failed and so doesn't dismiss like it would if the file has gone through without a hitch, fails to insert the proper img tag, and finally I have to cancel out of it to get back to editor.

uploadstash is busted. $this->user->isLoggedIn() chokes my script and I get the following error:

Uncaught TypeError: this.slice is not a function

    at uploadChunk (<anonymous>:247:78)

    at retry (<anonymous>:247:902)

TespSam (talkcontribs)

Questions are, how do I get this thing to play nice with immutable session providers?...@Otheus any ideas?

How do I get it to play nice with moderation extension?...@Edward Chernenko any ideas?

@Dan-nl any ideas?

Edward Chernenko (talkcontribs)

Moderation stores pending uploads in the user's upload stash. If the upload stash itself is not working in MediaWiki core, there is not much we can do.

This is something that should be fixed in whatever "remote login" extension you are using (apparently it doesn't populate $wgUser, thus the problem).

TespSam (talkcontribs)

@Edward Chernenko 'Auth_remoteuser' extension was re-written to implement all the authmanager and sessionmanager changes that happened in 1.27. wgUser, shouldn't be used in new code, according to Manual:$wgUser but it doesn't suggest how to go about replacing it. The documentation for all this stuff sucks. So you think that wgUser is the way to go huh?

Edward Chernenko (talkcontribs)

Some parts of MediaWiki core may still use deprecated globals such as $wgUser, or non-deprecated approach of RequestContext::getMain(). If you are the author of this authorization extension, you should check whether they are set (for backward compatibility reasons). For example, after the successful login via AuthManager, you can try something like this:

global $wgUser;
$wgUser = $newUser;
RequestContext::getMain()->setUser( $newUser );

Moderation uses RequestContext::getMain()->getUser() to determine the owner of stash.

Reply to "UploadStashNotLoggedInException"