nguyenkim thuat | 4 Jun 2012 15:50
Picon

Get the number of the revision when deleting a file attachment?

Hi,
When deleting a file attachment via the Mediawiki::API->edit, how to get the revision number at that moment?
For example, when i upload a file, i can find it by the query:
  # Find the number of revision of the page which has the id="$id"
  my $query = {
                        action => 'query',
                        prop => 'revisions',
                        rvprop => 'ids',
                        pageids => $id,
                };
                my $result = $mediawiki->api($query);
  ..........................................................................

But, when deleting a file, we can't use this mechanism. I wonder if the API support a function to get this number of revision?
Thanks.

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Platonides | 4 Jun 2012 17:45
Picon

Re: Get the number of the revision when deleting a file attachment?

On 04/06/12 15:50, nguyenkim thuat wrote:
> Hi,
> When deleting a file attachment via the Mediawiki::API->edit, how to get
> the revision number at that moment?
> For example, when i upload a file, i can find it by the query:
>   *# Find the number of revision of the page which has the id="$id"*
> * /my $query = {
>                         action => 'query',
>                         prop => 'revisions',
>                         rvprop => 'ids',
>                         pageids => $id,
>                 };
>                 my $result = $mediawiki->api($query);
>   ..........................................................................
> /
> *But, when deleting a file, we can't use this mechanism. I wonder if the
> API support a function to get this number of revision?
> Thanks.

Files don't have a revision number.
You seem to be checking the revision of the description page of a file.

Or by "deleting a file attachment" you mean "edit the page to change
text"? (which incidentally happens to remove an image from it)
nguyenkim thuat | 5 Jun 2012 14:53
Picon
Picon

Re: Get the number of the revision when deleting a file attachment?

On Mon, Jun 4, 2012 at 5:45 PM, Platonides <platonides <at> gmail.com> wrote:
On 04/06/12 15:50, nguyenkim thuat wrote:
> Hi,
> When deleting a file attachment via the Mediawiki::API->edit, how to get
> the revision number at that moment?
> For example, when i upload a file, i can find it by the query:
>   *# Find the number of revision of the page which has the id="$id"*
> * /my $query = {
>                         action => 'query',
>                         prop => 'revisions',
>                         rvprop => 'ids',
>                         pageids => $id,
>                 };
>                 my $result = $mediawiki->api($query);
>   ..........................................................................
> /
> *But, when deleting a file, we can't use this mechanism. I wonder if the
> API support a function to get this number of revision?
> Thanks.

Files don't have a revision number.
You seem to be checking the revision of the description page of a file.

Yeah, i know that file doesn't have the revision number but when we delete a file attachment. we have also a revision number for it. My question is how to get this number via the API. 
Or by "deleting a file attachment" you mean "edit the page to change
text"? (which incidentally happens to remove an image from it
No, i mean deleting a file in the list of file uploads.
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Gmane