Tobias Gritschacher has submitted this change and it was merged.
Change subject: (bug 42063) Enable Special:EntityData in production.
......................................................................
(bug 42063) Enable Special:EntityData in production.
This contains several minor changes:
* take Special:EntityData out of experimental mode
* silence warnings
* skip claims
* resolve protocol-relative URIs
Change-Id: I8ceba8abf3a4f0ab0f472a44d1482cd7169f2da1
---
M repo/Wikibase.classes.php
M repo/Wikibase.hooks.php
M repo/Wikibase.php
M repo/config/Wikibase.experimental.php
M repo/includes/rdf/RdfBuilder.php
M repo/includes/rdf/RdfSerializer.php
6 files changed, 11 insertions(+), 13 deletions(-)
Approvals:
Tobias Gritschacher: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php
index 945ff67..33fa371 100644
--- a/repo/Wikibase.classes.php
+++ b/repo/Wikibase.classes.php
@@ -114,6 +114,7 @@
'SpecialItemsWithoutSitelinks' =>
'includes/specials/SpecialItemsWithoutSitelinks.php',
'SpecialListDatatypes' =>
'includes/specials/SpecialListDatatypes.php',
'SpecialDispatchStats' =>
'includes/specials/SpecialDispatchStats.php',
+ 'SpecialEntityData' =>
'includes/specials/SpecialEntityData.php',
// includes/store
'Wikibase\EntityPerPage' => 'includes/store/EntityPerPage.php',
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index f5f2e59..a896770 100755
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -194,6 +194,7 @@
'rdf/RdfBuilder',
'rdf/RdfSerializer',
+ 'specials/SpecialEntityData',
'specials/SpecialNewItem',
'specials/SpecialNewProperty',
'specials/SpecialItemDisambiguation',
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index b299d85..1a6e586 100755
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -123,6 +123,7 @@
$wgSpecialPages['NewProperty']
= 'SpecialNewProperty';
$wgSpecialPages['ListDatatypes'] =
'SpecialListDatatypes';
$wgSpecialPages['DispatchStats'] =
'SpecialDispatchStats';
+$wgSpecialPages['EntityData'] =
'SpecialEntityData';
// Special page groups
$wgSpecialPageGroups['NewItem']
= 'wikibaserepo';
diff --git a/repo/config/Wikibase.experimental.php
b/repo/config/Wikibase.experimental.php
index 235c57a..462f823 100644
--- a/repo/config/Wikibase.experimental.php
+++ b/repo/config/Wikibase.experimental.php
@@ -49,15 +49,11 @@
$wgAutoloadClasses['Wikibase\Api\SetQualifier'] = $dir .
'includes/api/SetQualifier.php';
$wgAutoloadClasses['Wikibase\Api\SetStatementRank'] = $dir .
'includes/api/SetStatementRank.php';
-$wgAutoloadClasses['SpecialEntityData'] = $dir
. 'includes/specials/SpecialEntityData.php';
-
unset( $dir );
$wgAPIModules['wbremovequalifiers'] =
'Wikibase\Api\RemoveQualifiers';
$wgAPIModules['wbsetqualifier'] =
'Wikibase\Api\SetQualifier';
$wgAPIModules['wbsetstatementrank'] =
'Wikibase\Api\SetStatementRank';
-
-$wgSpecialPages['EntityData'] =
'SpecialEntityData';
/**
* Hook to add PHPUnit test cases.
@@ -75,9 +71,6 @@
'api/RemoveQualifiers',
'api/SetStatementRank',
'api/SetQualifier',
-
- 'specials/SpecialEntityData',
-
);
foreach ( $testFiles as $file ) {
diff --git a/repo/includes/rdf/RdfBuilder.php b/repo/includes/rdf/RdfBuilder.php
index 09c51e3..3557875 100755
--- a/repo/includes/rdf/RdfBuilder.php
+++ b/repo/includes/rdf/RdfBuilder.php
@@ -317,7 +317,9 @@
continue;
}
- $pageRecourse = $this->graph->resource( $link->getUrl()
);
+ //XXX: ideally, we'd use https if the target site
supports it.
+ $url = wfExpandUrl( $link->getUrl(), PROTO_HTTP );
+ $pageRecourse = $this->graph->resource( $url );
$entityResource->addResource( 'foaf:primaryTopicOf',
$pageRecourse, $languageCode );
}
}
@@ -360,7 +362,7 @@
$this->addPropertyValueSnak( $entity, $claim, $snak );
} else {
//TODO: NoValueSnak, SomeValueSnak
- wfWarn( "Unsupported snak type: " . get_class( $snak )
);
+ wfDebug( __METHOD__ . ": Unsupported snak type: " .
get_class( $snak ) );
}
}
@@ -394,7 +396,7 @@
$statementResource = $this->getStatementResource( $claim );
$entityResource->addResource( $propertyQName,
$statementResource );
- $value = $snak->getDataValue()->getValue();
+ $value = $snak->getDataValue();
$this->entityMentioned( $propertyId );
$this->addClaimValue( $claim, $propertyId, $value );
@@ -428,7 +430,7 @@
break;
default:
//TODO: more media types
- wfWarn( "Unsupported data type: $typeId" );
+ wfDebug( __METHOD__ . ": Unsupported data type:
$typeId\n" );
}
}
@@ -467,7 +469,7 @@
$this->addSiteLinks( $entity );
}
- $this->addClaims( $entity );
+ //$this->addClaims( $entity ); //TODO: finish this.
}
/**
diff --git a/repo/includes/rdf/RdfSerializer.php
b/repo/includes/rdf/RdfSerializer.php
index 54f5c3d..409a019 100755
--- a/repo/includes/rdf/RdfSerializer.php
+++ b/repo/includes/rdf/RdfSerializer.php
@@ -100,7 +100,7 @@
*/
public static function getFormat( $name ) {
if ( !self::isSupported() ) {
- wfWarn( "EasyRdf not found" );
+ wfDebug( __METHOD__ . ": EasyRdf not found\n" );
return null;
}
--
To view, visit https://gerrit.wikimedia.org/r/62796
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ceba8abf3a4f0ab0f472a44d1482cd7169f2da1
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Denny Vrandecic <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits