Index: trunk/extensions/Collection/Collection.suggest.php |
— | — | @@ -158,7 +158,6 @@ |
159 | 159 | private static function getCollectionSuggestTemplate( $mode, $param ) { |
160 | 160 | global $wgCollectionMaxSuggestions; |
161 | 161 | |
162 | | - |
163 | 162 | switch($mode) { |
164 | 163 | case 'add': |
165 | 164 | SpecialCollection::addArticleFromName(NS_MAIN, $param); |
— | — | @@ -472,6 +471,10 @@ |
473 | 472 | foreach ( $linkcount as $link => $count ) { |
474 | 473 | $result[$link] = 1 + 0.5*log($count)/$norm; |
475 | 474 | } |
| 475 | + } else { |
| 476 | + foreach ( $linkcount as $link => $count ) { |
| 477 | + $result[$link] = 1; |
| 478 | + } |
476 | 479 | } |
477 | 480 | |
478 | 481 | return $result; |
— | — | @@ -508,8 +511,12 @@ |
509 | 512 | } |
510 | 513 | usort( $prop, "wgCollectionCompareProps" ); |
511 | 514 | $this->mPropList = array(); |
| 515 | + $have_real_weights = false; |
512 | 516 | foreach ( $prop as $p ) { |
513 | | - if ( $p['val'] <= 1 ) { |
| 517 | + if ( $p['val'] > 1 ) { |
| 518 | + $have_real_weights = true; |
| 519 | + } |
| 520 | + if ( $p['val'] <= 1 && $have_real_weights ) { |
514 | 521 | break; |
515 | 522 | } |
516 | 523 | $this->mPropList[] = $p; |