Skip to content

Commit

Permalink
Merge "Remove hard-coded supportedEntityTypesForEntitiesWithoutTermLi…
Browse files Browse the repository at this point in the history
…stings default"
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Jan 4, 2017
2 parents 666d13c + 999e77e commit 28ead4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/options.wiki
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ As usual, the extension is configured in MediaWiki's LocalSettings.php file. How
;allowEntityImport: Allow importing entities via Special:Import and importDump.php. Per default, imports are forbidden, since entities defined in another wiki would have or use IDs that conflict with entities defined locally.
;pagePropertiesRdf: Array that maps between page properties and Wikibase predicates for RDF dumps. Maps from database property name to an array that contains a key <code>'name'</code> (RDF property name, which will be prefixed by <code>wikibase:</code>) and an optional key <code>'type'</code>.
;unitStorage: Definition for unit conversion storage. Should be in in the format <code>ObjectFactory</code> understands, example: <code>array( 'class' => 'Wikibase\\Lib\\JsonUnitStorage', 'args' => array( 'myUnits.json' ) )</code>.
;supportedEntityTypesForEntitiesWithoutTermListings: Array of entity types that are supported on Special:EntitiesWithoutLabel and on Special:EntitiesWithoutDescription. Can contain either "item" or "property" (or both).
;supportedEntityTypesForEntitiesWithoutTermListings: Array of entity types that are supported on Special:EntitiesWithoutLabel and …Description, typically <code>'item'</code> and <code>'property'</code>. Defaults to <code>null</code>, which enables all numeric entity types.
== Client Settings ==
Expand Down
6 changes: 2 additions & 4 deletions repo/config/Wikibase.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@
// Map of foreign repository names to repository-specific settings such as "supportedEntityTypes"
'foreignRepositories' => [],

'supportedEntityTypesForEntitiesWithoutTermListings' => [
'item',
'property'
]
// List of entity types for Special:EntitiesWithoutLabel and …Description, or null for all.
'supportedEntityTypesForEntitiesWithoutTermListings' => null,
];
8 changes: 7 additions & 1 deletion repo/includes/Specials/SpecialEntitiesWithoutPageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ class SpecialEntitiesWithoutPageFactory {

private static function newFromGlobalState() {
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
$entityTypes = $wikibaseRepo->getSettings()->getSetting( 'supportedEntityTypesForEntitiesWithoutTermListings' );
$entityTypes = $wikibaseRepo->getSettings()->getSetting(
'supportedEntityTypesForEntitiesWithoutTermListings'
);

if ( $entityTypes === null ) {
$entityTypes = $wikibaseRepo->getLocalEntityTypes();
}

return new self(
$wikibaseRepo->getStore()->newEntitiesWithoutTermFinder(),
Expand Down

0 comments on commit 28ead4a

Please sign in to comment.