Author Topic: Mediawiki: How to increase the number of exported category pages (default 5000)  (Read 193 times)

spiros

  • Administrator
  • Hero Member
  • *****
  • Posts: 299216
  • Gender: Male
  • point d’amour
    • spiros.doikas
    • greektranslator
    • doikas
    • 102094522373850556729
    • lavagraph
    • Greek translator CV
Mediawiki: How to increase the number of exported category pages (default 5000)

In Special:Export if you enter a category in the Add pages from category textbox, there is a hardcoded limit of 5000 page titles in the function getPagesFromCategory().

The same is true for a similar function fetching pages by namespace instead of category, function getPagesFromNamespace().

To change this, open includes/specials/SpecialExport.php

Search for 5000 and change the limit accordingly. Example code:
   
Code: [Select]
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select(
array( 'page', 'categorylinks' ),
array( 'page_namespace', 'page_title' ),
array( 'cl_from=page_id', 'cl_to' => $name ),
__METHOD__,
array( 'LIMIT' => '5000' )
);

See also:
https://www.mail-archive.com/search?l=mediawiki-commits@lists.wikimedia.org&q=subject:%22%5C%5BMediaWiki%5C-commits%5C%5D+%5C%5BGerrit%5C%5D+fix+hardcoded+limit+on+titles+in%09Special%5C%3AExport+%5C-+change+%5C(mediawiki%5C%2Fcore%5C)%22&o=newest&f=1
« Last Edit: 30 Jul, 2017, 10:59:37 by spiros »