Index: trunk/phase3/includes/specials/SpecialWantedfiles.php |
— | — | @@ -35,9 +35,19 @@ |
36 | 36 | return 'Wantedfiles'; |
37 | 37 | } |
38 | 38 | |
| 39 | + /** |
| 40 | + * KLUGE: The results may contain false positives for files |
| 41 | + * that exist e.g. in a shared repo. Setting this at least |
| 42 | + * keeps them from showing up as redlinks in the output, even |
| 43 | + * if it doesn't fix the real problem (bug 6220). |
| 44 | + */ |
| 45 | + function forceExistenceCheck() { |
| 46 | + return true; |
| 47 | + } |
| 48 | + |
39 | 49 | function getSQL() { |
40 | 50 | $dbr = wfGetDB( DB_SLAVE ); |
41 | | - list( $imagelinks, $page ) = $dbr->tableNamesN( 'imagelinks', 'page' ); |
| 51 | + list( $imagelinks, $image ) = $dbr->tableNamesN( 'imagelinks', 'image' ); |
42 | 52 | $name = $dbr->addQuotes( $this->getName() ); |
43 | 53 | return |
44 | 54 | " |
— | — | @@ -47,8 +57,8 @@ |
48 | 58 | il_to as title, |
49 | 59 | COUNT(*) as value |
50 | 60 | FROM $imagelinks |
51 | | - LEFT JOIN $page ON il_to = page_title AND page_namespace = ". NS_FILE ." |
52 | | - WHERE page_title IS NULL |
| 61 | + LEFT JOIN $image ON il_to = img_name |
| 62 | + WHERE img_name IS NULL |
53 | 63 | GROUP BY il_to |
54 | 64 | "; |
55 | 65 | } |
Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -581,6 +581,17 @@ |
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
| 585 | + * Should formatResult() always check page existence, even if |
| 586 | + * the results are fresh? This is a (hopefully temporary) |
| 587 | + * kluge for Special:WantedFiles, which may contain false |
| 588 | + * positives for files that exist e.g. in a shared repo (bug |
| 589 | + * 6220). |
| 590 | + */ |
| 591 | + function forceExistenceCheck() { |
| 592 | + return false; |
| 593 | + } |
| 594 | + |
| 595 | + /** |
585 | 596 | * Format an individual result |
586 | 597 | * |
587 | 598 | * @param $skin Skin to use for UI elements |
— | — | @@ -590,8 +601,8 @@ |
591 | 602 | public function formatResult( $skin, $result ) { |
592 | 603 | $title = Title::makeTitleSafe( $result->namespace, $result->title ); |
593 | 604 | if( $title instanceof Title ) { |
594 | | - if( $this->isCached() ) { |
595 | | - $pageLink = $title->exists() |
| 605 | + if( $this->isCached() || $this->forceExistenceCheck() ) { |
| 606 | + $pageLink = $title->isKnown() |
596 | 607 | ? '<del>' . $skin->link( $title ) . '</del>' |
597 | 608 | : $skin->link( |
598 | 609 | $title, |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -447,6 +447,8 @@ |
448 | 448 | * (bug 26160) Upload description set by extensions are not propagated |
449 | 449 | * (bug 9675) generateSitemap.php now takes an --urlpath parameter to allow |
450 | 450 | absolute URLs in the sitemap index (as required e.g. by Google) |
| 451 | +* Partial workaround for bug 6220: at least make files on shared repositories |
| 452 | + show up as (struck-out) bluelinks instead of redlinks on Special:WantedFiles |
451 | 453 | |
452 | 454 | === API changes in 1.17 === |
453 | 455 | * (bug 22738) Allow filtering by action type on query=logevent. |