r48796 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48795‎ | r48796 | r48797 >
Date:08:46, 25 March 2009
Author:brion
Status:ok
Tags:
Comment:
Revert r47530 "Fix bug 17571, now page1 would add to both cat1 and cat2."
Code is unclear; needs cleanup before adding more instances of this :D
Modified paths:
  • /trunk/phase3/includes/LinksUpdate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LinksUpdate.php
@@ -428,25 +428,18 @@
429429 function getCategoryInsertions( $existing = array() ) {
430430 global $wgContLang;
431431 $diffs = array_diff_assoc( $this->mCategories, $existing );
432 - foreach ( $this->mCategories as $name => $sortkey ) {
433 - $newname = $name;
434 - $nt = Title::makeTitleSafe( NS_CATEGORY, $newname );
435 - $wgContLang->findVariantLink( $newname, $nt, true );
 432+ $arr = array();
 433+ foreach ( $diffs as $name => $sortkey ) {
 434+ $nt = Title::makeTitleSafe( NS_CATEGORY, $name );
 435+ $wgContLang->findVariantLink( $name, $nt, true );
436436 // for category redirection
437437 if ( $nt->isRedirect() ) {
438438 $at = new Article( $nt );
439439 $nt = $at->getRedirectTarget();
440 - $newname = $nt->getText();
441440 // we only redirect a category to another category
442 - if ( ! array_key_exists( $newname, $existing )
443 - and $nt->getNamespace() == NS_CATEGORY )
444 - $diffs[$newname] = $sortkey;
 441+ if ( $nt->getNamespace() == NS_CATEGORY )
 442+ $name = $nt->getText();
445443 }
446 - }
447 - $arr = array();
448 - foreach ( $diffs as $name => $sortkey ) {
449 - $nt = Title::makeTitleSafe( NS_CATEGORY, $name );
450 - $wgContLang->findVariantLink( $name, $nt, true );
451444 $arr[] = array(
452445 'cl_from' => $this->mId,
453446 'cl_to' => $name,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r47530Fix bug 17571, now page1 would add to both cat1 and cat2.philip06:47, 20 February 2009

Status & tagging log