Last modified: 2011-04-30 01:21:21 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 T20180, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18180 - Special:Export ignores parameters limit, dir and offset
Special:Export ignores parameters limit, dir and offset
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Export/Import (Other open bugs)
1.15.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/w/index.php?t...
:
: 15667 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-26 15:48 UTC by tani.kaoru
Modified: 2011-04-30 01:21 UTC (History)
3 users (show)

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


Attachments
Export.php -> recognise limit, dir and offset parameters (25.65 KB, application/octet-stream)
2009-09-09 07:43 UTC, azliq7
Details
Diff patch (1.11 KB, patch)
2009-09-12 08:37 UTC, azliq7
Details

Description tani.kaoru 2009-03-26 15:48:01 UTC
Contrary to the descriptions of the parameters on http://www.mediawiki.org/wiki/Parameters_to_Special:Export, Special:Export does not accept parameters limit, dir and offset.
When I try to get xml of limited number of revisions of specific wikipedia page, Special:Export always sends back all the revisions in ascending order. This cause malfunctions of receiving script due to the size of the xml.
As far as I know, this trouble appeared 25 or 26 March 2009. I was running some scripts to obtain past revisions of wikipedia pages and until then they had no problem.

Sample request (POST):
http://en.wikipedia.org/w/index.php?title=Special:Export&pages=XXXXX&dir=desc&limit=5&action=submit&history=1
Comment 1 tani.kaoru 2009-03-30 12:18:47 UTC
This might be misunderstanding. The description says "if the history parameter is true, then all versions of each page are returned."
Comment 2 azliq7 2009-09-03 22:49:21 UTC
I believe this bug still remains unfixed, as I am unable to obtain specific revisions of a page. Looking through the source code, the parameters "limit", "dir", and "offset" are still being used. However, using these parameters (in POST requests) seem to have no effect in Special:Export, even if the "history" parameter is true or false.

I believe that the bug is located between lines 79 and 110 of the code, but I may be wrong. 
Comment 3 Roan Kattouw 2009-09-04 09:05:35 UTC
(In reply to comment #2)
> even if the "history"
> parameter is true or false.
> 
Instead of setting &history=false , try setting &history=0 or not setting &history at all.
Comment 4 azliq7 2009-09-05 04:49:20 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > even if the "history"
> > parameter is true or false.
> > 
> Instead of setting &history=false , try setting &history=0 or not setting
> &history at all.
> 

With true or false, I meant history=1 or history=0. 
Ignoring the parameter didn't work for me. 

This is the summary of my results:
------------------------------------------------
curonly          history             result
------------------------------------------------
   -                -             full history
   1                -             current rev
   0                -             current rev
   -                1             full history
   -                0             full history
   0                0             current rev
   1                0             current rev
   0                1             current rev
   1                1             current rev
------------------------------------------------
Comment 5 azliq7 2009-09-07 07:43:27 UTC
In the tests I conducted, I tried using all three parameters (limit, offset, dir), and a combination of these. Using the parameters had no effect, and Special:Export simply produced the results mentioned in "Comment #4". 

According to "tani.kaoru@gmail.com", this bug occurred in Wikipedia sometime in March 2009. In our wiki run by Wikia, we recently upgraded from version 1.15 to 1.15.1, and Special:Export started ignoring the parameters. I think it is safe to assume that this bug is related to the 1.15.1 upgrade.
Comment 6 azliq7 2009-09-07 08:57:39 UTC
Changing the version to 1.15.1.
Comment 7 azliq7 2009-09-09 07:30:23 UTC
If I knew how to produce a patch, I would have. But I simply don't know how to go about it.

********************************
File: /includes/export.php
********************************

This involves moving the if statement of "# Full history dumps..." (Line 210) below the if statement of "Time offset/limit for all pages/history..." (Line 229)

The time offset/limit parameters were being ignored because the if statement for "Full history dumps" was being triggered first.
Moving the if statement for "Time offset/limit for all pages/history" parameters above the full history seemed to have solved the bug.

I tested this in my wiki, and after this patch, the parameters are now being recognised. I was able to export specific revisions of a page.
Comment 8 azliq7 2009-09-09 07:43:14 UTC
Created attachment 6534 [details]
Export.php -> recognise limit, dir and offset parameters

This version of "Export.php" should recognise the limit, dir, and offset parameters.
Comment 9 azliq7 2009-09-12 08:37:58 UTC
Created attachment 6544 [details]
Diff patch

Patch to recognise offset/limit/dir parameters
Comment 10 Roan Kattouw 2009-09-13 15:33:52 UTC
*** Bug 15667 has been marked as a duplicate of this bug. ***
Comment 11 Roan Kattouw 2009-09-14 13:02:59 UTC
Patch applied in r56298
Comment 12 Brion Vibber 2009-09-29 21:37:35 UTC
Some followup tweaks in r57083

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


Navigation
Links