jenkins-bot has submitted this change and it was merged.
Change subject: Support coordinate and entityidvalue when generating claim
autosummary
......................................................................
Support coordinate and entityidvalue when generating claim autosummary
- this is a fix for deployment only
- coordinates were just left blank in the summaries till now
- also the entityid were not shown anymore due to the changes in the
EntityId class
- on master this should be fixed using formatters
Change-Id: Ie6e26e47e6da7356bda151159ccad8237fd0596f
---
M repo/includes/ClaimSummaryBuilder.php
1 file changed, 13 insertions(+), 1 deletion(-)
Approvals:
Daniel Kinzler: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/includes/ClaimSummaryBuilder.php
b/repo/includes/ClaimSummaryBuilder.php
index e338fd0..f17cbc8 100644
--- a/repo/includes/ClaimSummaryBuilder.php
+++ b/repo/includes/ClaimSummaryBuilder.php
@@ -2,9 +2,11 @@
namespace Wikibase;
+use Wikibase\DataModel\Entity\EntityIdValue;
use DataValues\TimeValue;
use InvalidArgumentException;
use Wikibase\Lib\EntityIdFormatter;
+use DataValues\GlobeCoordinateValue;
/**
* EditSummary-Builder for claim operations
@@ -130,9 +132,19 @@
if ( $snak instanceof PropertyValueSnak ) {
$value = $snak->getDataValue();
+
// TODO: we should use value formatters
here!
- if ( $value instanceof TimeValue ) {
+ if ( $value instanceof EntityIdValue ) {
+ $value = $value->getEntityId();
+ } elseif ( $value instanceof TimeValue
) {
$value = $value->getTime();
+ } elseif ( $value instanceof
GlobeCoordinateValue ) {
+ $value = $value->getLatitude()
. ', ' . $value->getLongitude();
+ } elseif ( is_string(
$value->getValue() ) ) {
+ $value = $value->getValue();
+ } else {
+ //type not supported;
+ $value = "";
}
} else {
$value = $snak->getType(); // todo
handle no values in general way (needed elsewhere)
--
To view, visit https://gerrit.wikimedia.org/r/82820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6e26e47e6da7356bda151159ccad8237fd0596f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.22-wmf16
Gerrit-Owner: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits