r58715 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58714‎ | r58715 | r58716 >
Date:15:56, 7 November 2009
Author:btongminh
Status:ok
Tags:
Comment:
Follow-up to r58706: Commit missing fix to GlobalUsage_body.php and fix filesort in refreshGlobalimagelinsk.php
Modified paths:
  • /trunk/extensions/GlobalUsage/GlobalUsage_body.php (modified) (history)
  • /trunk/extensions/GlobalUsage/refreshGlobalimagelinks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalUsage/GlobalUsage_body.php
@@ -21,12 +21,12 @@
2222 * @param $title Title Title of the page
2323 * @param $images array Array of db keys of images used
2424 */
25 - public function setUsage( $title, $images ) {
 25+ public function setUsage( $title, $images, $pageIdFlags = GAID_FOR_UPDATE ) {
2626 $insert = array();
2727 foreach ( $images as $name ) {
2828 $insert[] = array(
2929 'gil_wiki' => $this->interwiki,
30 - 'gil_page' => $title->getArticleID( GAID_FOR_UPDATE ),
 30+ 'gil_page' => $title->getArticleID( $pageIdFlags ),
3131 'gil_page_namespace' => $title->getNsText(),
3232 'gil_page_title' => $title->getText(),
3333 'gil_to' => $name
Index: trunk/extensions/GlobalUsage/refreshGlobalimagelinks.php
@@ -36,8 +36,11 @@
3737 "(page_id = $lastPageId AND il_to > {$quotedLastIlTo})" .
3838 " OR page_id > $lastPageId",
3939 __METHOD__,
40 - array( 'ORDER BY' => 'page_id, il_to', 'LIMIT' => $limit ),
4140 array(
 41+ 'ORDER BY' => $dbr->implicitOrderBy() ? 'page_id' : 'page_id, il_to',
 42+ 'LIMIT' => $limit
 43+ ),
 44+ array(
4245 # LEFT JOIN imagelinks since we need to delete usage
4346 # from all images, even if they don't have images anymore
4447 'imagelinks' => array( 'LEFT JOIN', 'page_id = il_from' ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58706Add script to refresh the globalimagelinks tablebtongminh13:52, 7 November 2009

Status & tagging log