Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-20793-1463321642-1488.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 678
Download (untitled) / with headers
text/plain 678b
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};
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-20793-1463321642-1488.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-20793-1463321642-1488.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-6471-1606124415-1978.114392-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 796
Download (untitled) / with headers
text/plain 796b
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};


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.