r54696 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54695‎ | r54696 | r54697 >
Date:02:17, 10 August 2009
Author:mrzman
Status:deferred
Tags:
Comment:
Fix bug in which indexes wouldn't be deleted if all of them were removed from the page
Modified paths:
  • /trunk/extensions/IndexFunction/IndexFunction_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/IndexFunction/IndexFunction_body.php
@@ -216,7 +216,7 @@
217217 static function doIndexes( &$out, $parseroutput ) {
218218 global $wgTitle;
219219 if ( !isset($parseroutput->mIndexes) ) {
220 - return true;
 220+ $parseroutput->mIndexes = array();
221221 }
222222 if ( $parseroutput->getProperty( 'preview' ) ) {
223223 return true;
@@ -234,7 +234,7 @@
235235 }
236236 $toAdd = wfArrayDiff2( $parseroutput->mIndexes, $current );
237237 $toRem = wfArrayDiff2( $current, $parseroutput->mIndexes );
238 - if ( true ) {
 238+ if ( $toAdd || $toRem ) {
239239 $dbw->begin( __METHOD__ );
240240 if ( $toRem ) {
241241 $delCond = "in_from = $pageid AND (";

Status & tagging log