Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1570,7 +1570,7 @@ |
1571 | 1571 | |
1572 | 1572 | 'doubleredirects' => 'Double redirects', |
1573 | 1573 | 'doubleredirects-summary' => '', # only translate this message to other languages if you have to change it |
1574 | | -'doubleredirectstext' => 'Each row contains links to the first and second redirect, as well as the target of the second redirect, which is usually "real" target page, which the first redirect should point to.', |
| 1574 | +'doubleredirectstext' => 'The following redirects link to other redirect pages:', |
1575 | 1575 | |
1576 | 1576 | 'brokenredirects' => 'Broken redirects', |
1577 | 1577 | 'brokenredirects-summary' => '', # only translate this message to other languages if you have to change it |
Index: trunk/phase3/includes/SpecialDoubleRedirects.php |
— | — | @@ -22,37 +22,29 @@ |
23 | 23 | return wfMsgExt( 'doubleredirectstext', array( 'parse' ) ); |
24 | 24 | } |
25 | 25 | |
26 | | - function getSQLText( &$dbr, $namespace = null, $title = null ) { |
27 | | - |
| 26 | + function getSql() { |
| 27 | + $dbr = wfGetDB( DB_SLAVE ); |
28 | 28 | list( $page, $redirect ) = $dbr->tableNamesN( 'page', 'redirect' ); |
29 | | - |
30 | | - $limitToTitle = !( $namespace === null && $title === null ); |
31 | | - $sql = $limitToTitle ? "SELECT" : "SELECT 'DoubleRedirects' as type," ; |
32 | | - $sql .= |
33 | | - " pa.page_namespace as namespace, pa.page_title as title," . |
34 | | - " pb.page_namespace as nsb, pb.page_title as tb," . |
35 | | - " pc.page_namespace as nsc, pc.page_title as tc" . |
36 | | - " FROM $redirect AS ra, $redirect AS rb, $page AS pa, $page AS pb, $page AS pc" . |
37 | | - " WHERE ra.rd_from=pa.page_id" . |
38 | | - " AND ra.rd_namespace=pb.page_namespace" . |
39 | | - " AND ra.rd_title=pb.page_title" . |
40 | | - " AND rb.rd_from=pb.page_id" . |
41 | | - " AND rb.rd_namespace=pc.page_namespace" . |
42 | | - " AND rb.rd_title=pc.page_title"; |
43 | | - |
44 | | - if( $limitToTitle ) { |
45 | | - $encTitle = $dbr->addQuotes( $title ); |
46 | | - $sql .= " AND pa.page_namespace=$namespace" . |
47 | | - " AND pa.page_title=$encTitle"; |
48 | | - } |
49 | | - |
50 | | - return $sql; |
| 29 | + return " |
| 30 | + SELECT |
| 31 | + 'DoubleRedirects' as type, |
| 32 | + pa.page_namespace as namespace, pa.page_title as title, |
| 33 | + pb.page_namespace as nsb, pb.page_title as tb, |
| 34 | + pc.page_namespace as nsc, pc.page_title as tc |
| 35 | + FROM |
| 36 | + $redirect AS ra, |
| 37 | + $redirect AS rb, |
| 38 | + $page AS pa, |
| 39 | + $page AS pb, |
| 40 | + $page AS pc |
| 41 | + WHERE |
| 42 | + ra.rd_from = pa.page_id |
| 43 | + AND ra.rd_namespace = pb.page_namespace |
| 44 | + AND ra.rd_title = pb.page_title |
| 45 | + AND rb.rd_from = pb.page_id |
| 46 | + AND rb.rd_namespace = pc.page_namespace |
| 47 | + AND rb.rd_title = pc.page_title"; |
51 | 48 | } |
52 | | - |
53 | | - function getSQL() { |
54 | | - $dbr = wfGetDB( DB_SLAVE ); |
55 | | - return $this->getSQLText( $dbr ); |
56 | | - } |
57 | 49 | |
58 | 50 | function getOrder() { |
59 | 51 | return ''; |
— | — | @@ -60,33 +52,30 @@ |
61 | 53 | |
62 | 54 | function formatResult( $skin, $result ) { |
63 | 55 | global $wgContLang; |
| 56 | + $parts = array(); |
64 | 57 | |
65 | | - $fname = 'DoubleRedirectsPage::formatResult'; |
66 | 58 | $titleA = Title::makeTitle( $result->namespace, $result->title ); |
67 | | - |
68 | | - if ( $result && !isset( $result->nsb ) ) { |
69 | | - $dbr = wfGetDB( DB_SLAVE ); |
70 | | - $sql = $this->getSQLText( $dbr, $result->namespace, $result->title ); |
71 | | - $res = $dbr->query( $sql, $fname ); |
72 | | - if ( $res ) { |
73 | | - $result = $dbr->fetchObject( $res ); |
74 | | - $dbr->freeResult( $res ); |
75 | | - } |
| 59 | + $parts[] = $skin->makeKnownLinkObj( $titleA, '', 'redirect=no' ); |
| 60 | + $parts[] = '(' . $skin->makeKnownLinkObj( |
| 61 | + $titleA, |
| 62 | + wfMsgHtml( 'qbedit' ), |
| 63 | + 'action=edit&redirect=no' |
| 64 | + ) . ')'; |
| 65 | + |
| 66 | + // If the report isn't cached, generate some useful additional |
| 67 | + // links to the target page, and *that* page's redirect target |
| 68 | + if( isset( $result->nsb ) ) { |
| 69 | + $parts[] = $wgContLang->getArrow() . $wgContLang->getDirMark(); |
| 70 | + $parts[] = $skin->makeKnownLinkObj( |
| 71 | + Title::makeTitle( $result->nsb, $result->tb ), |
| 72 | + '', |
| 73 | + 'redirect=no' |
| 74 | + ); |
| 75 | + $parts[] = $wgContLang->getArrow() . $wgContLang->getDirMark(); |
| 76 | + $parts[] = $skin->makeKnownLinkObj( Title::makeTitle( $result->nsc, $result->tc ) ); |
76 | 77 | } |
77 | | - if ( !$result ) { |
78 | | - return ''; |
79 | | - } |
80 | 78 | |
81 | | - $titleB = Title::makeTitle( $result->nsb, $result->tb ); |
82 | | - $titleC = Title::makeTitle( $result->nsc, $result->tc ); |
83 | | - |
84 | | - $linkA = $skin->makeKnownLinkObj( $titleA,'', 'redirect=no' ); |
85 | | - $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsg("qbedit").")" , 'redirect=no'); |
86 | | - $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' ); |
87 | | - $linkC = $skin->makeKnownLinkObj( $titleC ); |
88 | | - $arr = $wgContLang->getArrow() . $wgContLang->getDirMark(); |
89 | | - |
90 | | - return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); |
| 79 | + return implode( ' ', $parts ); |
91 | 80 | } |
92 | 81 | } |
93 | 82 | |
— | — | @@ -95,10 +84,6 @@ |
96 | 85 | */ |
97 | 86 | function wfSpecialDoubleRedirects() { |
98 | 87 | list( $limit, $offset ) = wfCheckLimits(); |
99 | | - |
100 | 88 | $sdr = new DoubleRedirectsPage(); |
101 | | - |
102 | 89 | return $sdr->doQuery( $offset, $limit ); |
103 | | - |
104 | | -} |
105 | | - |
| 90 | +} |
\ No newline at end of file |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -396,6 +396,8 @@ |
397 | 397 | lost and transparent pixels to be turned black |
398 | 398 | * (bug 9339) General error pages were transforming messages and their parameters |
399 | 399 | in the wrong order |
| 400 | +* (bug 10985) Special:DoubleRedirects was omitting "fixed" results when cached, |
| 401 | + leading to inconsistent paging behaviour |
400 | 402 | |
401 | 403 | == API changes since 1.10 == |
402 | 404 | |