Skip Menu |

This queue is for tickets about the MediaWiki-API CPAN distribution.

Report information
The Basics
Id: 114392
Status: rejected
Priority: 0/
Queue: MediaWiki-API

People
Owner: Nobody in particular
Requestors: HPAVC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.41
Fixed in: (no value)



Subject: api upload issue
The method API upload seems broken, it always requires a token similar to this, I cal call this method between two $wm->edit() calls and the edits will work fine, if I remove the token and the die() the function will ... "3: notoken: The token parameter must be set at" $mw->api( { action => 'upload', token => $mw->{'config'}->{'tokens'}->{'edit'}, ignorewarnings => 1, filename => $imgtitle, comment => '[[Category:Portraits]][[Category:Clipart]]', file => [ undef, $imgtitle, Content => $imgdata ], } ) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};
use the "edit" call and the token will be set automatically. Using the api call you have to handle any token work. On Sun May 15 10:14:02 2016, HPAVC wrote: Show quoted text
> The method API upload seems broken, it always requires a token similar > to this, I cal call this method between two $wm->edit() calls and the > edits will work fine, if I remove the token and the die() the function > will ... "3: notoken: The token parameter must be set at" > > $mw->api( { > action => 'upload', > token => $mw->{'config'}->{'tokens'}->{'edit'}, > ignorewarnings => 1, > filename => $imgtitle, > comment => '[[Category:Portraits]][[Category:Clipart]]', > file => [ undef, $imgtitle, Content => $imgdata ], > } ) > || die $mw->{error}->{code} . ': ' . $mw->{error}->{details};