r80590 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80589‎ | r80590 | r80591 >
Date:21:51, 19 January 2011
Author:bawolff
Status:ok (Comments)
Tags:
Comment:
Follow up r80432. Don't use 'known', 'noclasses' when making the links on category pages.

This appears to date back all the way to r23952, originally as a way to make sure redirects
were not marked as 'stub'. Thats now a non-issue since redirects don't get marked as stubs.

Also make marking of redirects consistent between the pages section and the subcategory section.
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -177,14 +177,16 @@
178178 function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
179179 // Subcategory; strip the 'Category' namespace from the link text.
180180 $title = $cat->getTitle();
181 - $this->children[] = $this->getSkin()->link(
182 - $title,
183 - $title->getText(),
184 - array(),
185 - array(),
186 - array( 'known', 'noclasses' )
187 - );
188181
 182+ $link = $this->getSkin()->link( $title, $title->getText() );
 183+ if ( $title->isRedirect() ) {
 184+ // This didn't used to add redirect-in-category, but might
 185+ // as well be consistent with the rest of the sections
 186+ // on a category page.
 187+ $link = '<span class="redirect-in-category">' . $link . '</span>';
 188+ }
 189+ $this->children[] = $link;
 190+
189191 $this->children_start_char[] =
190192 $this->getSubcategorySortChar( $cat->getTitle(), $sortkey );
191193 }
@@ -231,16 +233,13 @@
232234 $this->gallery->add( $title );
233235 }
234236 } else {
235 - $this->imgsNoGallery[] = $isRedirect
236 - ? '<span class="redirect-in-category">' .
237 - $this->getSkin()->link(
238 - $title,
239 - null,
240 - array(),
241 - array(),
242 - array( 'known', 'noclasses' )
243 - ) . '</span>'
244 - : $this->getSkin()->link( $title );
 237+ $link = $this->getSkin()->link( $title );
 238+ if ( $isRedirect ) {
 239+ // This seems kind of pointless given 'mw-redirect' class,
 240+ // but keeping for back-compatibility with user css.
 241+ $link = '<span class="redirect-in-category">' . $link . '</span>';
 242+ }
 243+ $this->imgsNoGallery[] = $link;
245244
246245 $this->imgsNoGallery_start_char[] = $wgContLang->convert(
247246 $this->collation->getFirstLetter( $sortkey ) );
@@ -252,17 +251,15 @@
253252 */
254253 function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
255254 global $wgContLang;
256 - $this->articles[] = $isRedirect
257 - ? '<span class="redirect-in-category">' .
258 - $this->getSkin()->link(
259 - $title,
260 - null,
261 - array(),
262 - array(),
263 - array( 'known', 'noclasses' )
264 - ) . '</span>'
265 - : $this->getSkin()->link( $title );
266255
 256+ $link = $this->getSkin()->link( $title );
 257+ if ( $isRedirect ) {
 258+ // This seems kind of pointless given 'mw-redirect' class,
 259+ // but keeping for back-compatiability with user css.
 260+ $link = '<span class="redirect-in-category">' . $link . '</span>';
 261+ }
 262+ $this->articles[] = $link;
 263+
267264 $this->articles_start_char[] = $wgContLang->convert(
268265 $this->collation->getFirstLetter( $sortkey ) );
269266 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r806781.17: MFT category collation changes: r80432, r80443, r80590, r80614, r80615,...catrope03:16, 21 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23952* (bug 9903) Don't mark redirects in categories as stubs [wrong semantics]...robchurch12:25, 10 July 2007
r80432(bug 26737; follow-up r70415) Make new category stuff play nice with __NOGALL...bawolff01:16, 17 January 2011

Comments

#Comment by Nikerabbit (talk | contribs)   07:45, 20 January 2011

I can confirm this doesn't cause any extra queries for me on translatewiki.net

Status & tagging log