Index: trunk/phase3/includes/SpecialWatchlist.php |
— | — | @@ -155,6 +155,15 @@ |
156 | 156 | $sql = "SELECT wl_namespace,wl_title FROM $watchlist WHERE wl_user=$uid"; |
157 | 157 | |
158 | 158 | $res = $dbr->query( $sql, $fname ); |
| 159 | + |
| 160 | + # Batch existence check |
| 161 | + $linkBatch = new LinkBatch(); |
| 162 | + while( $row = $dbr->fetchObject( $res ) ) |
| 163 | + $linkBatch->addObj( Title::makeTitleSafe( $row->wl_namespace, $row->wl_title ) ); |
| 164 | + $linkBatch->execute(); |
| 165 | + if( $dbr->numRows( $res ) > 0 ) |
| 166 | + $dbr->dataSeek( $res, 0 ); # Let's do the time warp again! |
| 167 | + |
159 | 168 | $sk = $wgUser->getSkin(); |
160 | 169 | |
161 | 170 | $list = array(); |
— | — | @@ -170,19 +179,19 @@ |
171 | 180 | $wgOut->addHTML( '<h2>' . $wgContLang->getFormattedNsText( $ns ) . '</h2>' ); |
172 | 181 | $wgOut->addHTML( '<ul>' ); |
173 | 182 | foreach($titles as $title) { |
174 | | - $t = Title::makeTitle( $ns, $title ); |
175 | | - if( is_null( $t ) ) { |
| 183 | + $titleObj = Title::makeTitle( $ns, $title ); |
| 184 | + if( is_null( $titleObj ) ) { |
176 | 185 | $wgOut->addHTML( |
177 | 186 | '<!-- bad title "' . |
178 | 187 | htmlspecialchars( $s->wl_title ) . '" in namespace ' . $s->wl_namespace . " -->\n" |
179 | 188 | ); |
180 | 189 | } else { |
181 | 190 | global $wgContLang; |
182 | | - $t = $t->getPrefixedText(); |
| 191 | + $titleText = $titleObj->getPrefixedText(); |
| 192 | + $talkLink = $sk->makeLinkObj( $titleObj->getTalkPage(), $wgLang->getNsText( NS_TALK ) ); |
183 | 193 | $wgOut->addHTML( |
184 | | - '<li><input type="checkbox" name="id[]" value="' . htmlspecialchars($t) . '" />' . ' ' . ($wgContLang->isRTL() ? '‏' : '‎') . |
185 | | - $sk->makeLink( $t, $t ) . |
186 | | - "</li>\n" |
| 194 | + '<li><input type="checkbox" name="id[]" value="' . htmlspecialchars( $titleObj->getPrefixedText() ) . '" />' . ' ' . ( $wgContLang->isRTL() ? '‏' : '‎' ) . |
| 195 | + $sk->makeLinkObj( $titleObj ) . " ({$talkLink}) </li>\n" |
187 | 196 | ); |
188 | 197 | } |
189 | 198 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -392,6 +392,7 @@ |
393 | 393 | * Show links to user page, talk page and contributions page on Special:Newpages |
394 | 394 | * Special:Export can now export a list of all contributors to an article (off by default) |
395 | 395 | * (bug 5372) Add number of files to Special:Statistics |
| 396 | +* (bug 2871) Links to talk pages in watchlist editing view |
396 | 397 | |
397 | 398 | Misc.: |
398 | 399 | * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect |