Tobias Gritschacher has submitted this change and it was merged.
Change subject: (bug 48145) EntityView support for TimeValue data values
......................................................................
(bug 48145) EntityView support for TimeValue data values
Not nice but fits in with the current state of the ValueView. This is just for
not having an
error thrown. The handling in the place has not been nice before.
Change-Id: I1f6dc90b952492756b3cc296cb4d41d7e512e646
---
M repo/includes/EntityView.php
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Tobias Gritschacher: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/includes/EntityView.php b/repo/includes/EntityView.php
index 59e784f..a3b57ea 100644
--- a/repo/includes/EntityView.php
+++ b/repo/includes/EntityView.php
@@ -494,6 +494,11 @@
$value =
$claim->getMainSnak()->getDataValue()->getValue();
}
+ // TODO: bad to have a switch for different
data types here
+ if( $value instanceof \DataValues\TimeValue ) {
+ $value = $value->getTime();
+ }
+
$additionalCssClasses = '';
if ( $i++ === 0 ) {
$additionalCssClasses .= 'wb-first ';
--
To view, visit https://gerrit.wikimedia.org/r/61522
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f6dc90b952492756b3cc296cb4d41d7e512e646
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Werner <[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