Index: branches/wikidata/phase3/maintenance/nsBootstrap.php |
— | — | @@ -1,4 +1,8 @@ |
2 | 2 | <?php |
| 3 | +// Purpose: Create entries in the namespace and namespace_names tables, |
| 4 | +// based on the configured language. Take into account existing (deprecated) |
| 5 | +// namespace settings in an update. |
| 6 | +// |
3 | 7 | // We can't depend on commandLine.inc because this has to be runnable from the installer |
4 | 8 | global $wgLanguageCode; |
5 | 9 | $wgContLanguageCode = $wgLanguageCode; |
Index: branches/wikidata/phase3/skins/monobook/main.css |
— | — | @@ -1347,7 +1347,6 @@ |
1348 | 1348 | margin-bottom: 1em; |
1349 | 1349 | border: 1px solid #aaa; |
1350 | 1350 | padding: 1.5em 2em; |
1351 | | - background-color: #f9f9f9; |
1352 | 1351 | } |
1353 | 1352 | |
1354 | 1353 | /* noarticletext */ |
Index: branches/wikidata/phase3/includes/Title.php |
— | — | @@ -1191,7 +1191,11 @@ |
1192 | 1192 | $p = $this->mInterwiki . ':'; |
1193 | 1193 | } |
1194 | 1194 | if ( 0 != $this->mNamespace && ! defined( 'MEDIAWIKI_INSTALL' ) ) { |
1195 | | - $p .= $wgNamespaces[$this->mNamespace]->getDefaultName() . ':'; |
| 1195 | + if(array_key_exists($this->mNamespace,$wgNamespaces)) { |
| 1196 | + $p .= $wgNamespaces[$this->mNamespace]->getDefaultName() . ':'; |
| 1197 | + } else { |
| 1198 | + $p = wfMsg('namespace_missing_prefix').'_'.$this->mNamespace.':'; |
| 1199 | + } |
1196 | 1200 | } |
1197 | 1201 | return $p . $name; |
1198 | 1202 | } |
Index: branches/wikidata/phase3/includes/Namespace.php |
— | — | @@ -555,9 +555,8 @@ |
556 | 556 | $existsOld=array_key_exists($i, $wgNamespaces[$index]->names); |
557 | 557 | $existsNew=array_key_exists($i, $this->names); |
558 | 558 | if($existsOld && $existsNew) { |
559 | | - if(strcasecmp($wgNamespaces[$index]->names[$i], |
560 | | - $this->names[$i])!=0) { |
561 | | - $nameOperations[$this->names[$i]]=NS_NAME_MODIFY; |
| 559 | + if(strcasecmp($wgNamespaces[$index]->names[$i], $this->names[$i])!=0) { |
| 560 | + $nameOperations[$this->names[$i]]=NS_NAME_MODIFY; |
562 | 561 | } |
563 | 562 | } elseif($existsOld && !$existsNew) { |
564 | 563 | $nameOperations[$wgNamespaces[$index]->names[$i]]=NS_NAME_DELETE; |
— | — | @@ -583,13 +582,10 @@ |
584 | 583 | |
585 | 584 | # Duplicate names |
586 | 585 | foreach($wgNamespaces as $exns) { |
587 | | - if($exns->getIndex()!=$index) { |
588 | | - foreach($exns->names as $exname) { |
589 | | - if($exname == $name) { |
590 | | - $rv[NS_RESULT] = NS_NAME_ISSUES; |
591 | | - $rv[NS_DUPLICATE_NAMES][]=$name; |
592 | | - } |
593 | | - } |
| 586 | + $dupes=array_keys($exns->names,$name); |
| 587 | + if(count($dupes)) { |
| 588 | + $rv[NS_RESULT] = NS_NAME_ISSUES; |
| 589 | + $rv[NS_DUPLICATE_NAMES][]=$name; |
594 | 590 | } |
595 | 591 | } |
596 | 592 | |
Index: branches/wikidata/phase3/includes/SpecialNamespaces.php |
— | — | @@ -387,13 +387,12 @@ |
388 | 388 | } |
389 | 389 | |
390 | 390 | // We now have validated stuff, lets save for real. |
391 | | - |
392 | | - // TODO error handling ? |
| 391 | + // No logic errors should occur beyond this point. |
393 | 392 | $ns->save(); |
394 | 393 | $complete = wfMsg( 'namespace_created', $nsname ); |
395 | 394 | |
396 | 395 | if( $nscreatetalk ) { |
397 | | - // TODO error handling ? |
| 396 | + |
398 | 397 | $talkns->save(); |
399 | 398 | $complete .= ' '.wfMsg('talk_namespace_created'); |
400 | 399 | } |
— | — | @@ -498,7 +497,6 @@ |
499 | 498 | ) { |
500 | 499 | # Use this default name. |
501 | 500 | $newns[$nsindex]->setDefaultNameIndex($dindex); |
502 | | - #wfDebug("Setting index for $nsindex to $dindex!\n"); |
503 | 501 | } else { |
504 | 502 | # We have lost our default name, perhaps it was deleted. |
505 | 503 | # Get a new one if possible. |
Index: branches/wikidata/phase3/languages/Language.php |
— | — | @@ -2231,6 +2231,8 @@ |
2232 | 2232 | 'namespace_not_deletable_missing'=>'A namespace with the number $1 was not found.', |
2233 | 2233 | 'namespace_not_deletable_system'=>'The namespace with the number $1 is a system namespace which is required for the operation of MediaWiki.', |
2234 | 2234 | |
| 2235 | +# Other namespace stuff |
| 2236 | +'namespace_missing_prefix'=>'Invalid namespace', |
2235 | 2237 | |
2236 | 2238 | # Inputbox extension, may be useful in other contexts as well |
2237 | 2239 | 'tryexact' => 'Try exact match', |