Index: trunk/extensions/GlobalUsage/GlobalUsage_body.php |
— | — | @@ -21,12 +21,12 @@ |
22 | 22 | * @param $title Title Title of the page |
23 | 23 | * @param $images array Array of db keys of images used |
24 | 24 | */ |
25 | | - public function setUsage( $title, $images ) { |
| 25 | + public function setUsage( $title, $images, $pageIdFlags = GAID_FOR_UPDATE ) { |
26 | 26 | $insert = array(); |
27 | 27 | foreach ( $images as $name ) { |
28 | 28 | $insert[] = array( |
29 | 29 | 'gil_wiki' => $this->interwiki, |
30 | | - 'gil_page' => $title->getArticleID( GAID_FOR_UPDATE ), |
| 30 | + 'gil_page' => $title->getArticleID( $pageIdFlags ), |
31 | 31 | 'gil_page_namespace' => $title->getNsText(), |
32 | 32 | 'gil_page_title' => $title->getText(), |
33 | 33 | 'gil_to' => $name |
Index: trunk/extensions/GlobalUsage/refreshGlobalimagelinks.php |
— | — | @@ -36,8 +36,11 @@ |
37 | 37 | "(page_id = $lastPageId AND il_to > {$quotedLastIlTo})" . |
38 | 38 | " OR page_id > $lastPageId", |
39 | 39 | __METHOD__, |
40 | | - array( 'ORDER BY' => 'page_id, il_to', 'LIMIT' => $limit ), |
41 | 40 | array( |
| 41 | + 'ORDER BY' => $dbr->implicitOrderBy() ? 'page_id' : 'page_id, il_to', |
| 42 | + 'LIMIT' => $limit |
| 43 | + ), |
| 44 | + array( |
42 | 45 | # LEFT JOIN imagelinks since we need to delete usage |
43 | 46 | # from all images, even if they don't have images anymore |
44 | 47 | 'imagelinks' => array( 'LEFT JOIN', 'page_id = il_from' ), |