jenkins-bot has submitted this change and it was merged.

Change subject: DM 1.0 compat: do not use EntityId constructor
......................................................................


DM 1.0 compat: do not use EntityId constructor

Change-Id: Ie2d64795a790abf1095f8fe2fd885395cdb11cac
---
M lib/includes/Term.php
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/includes/Term.php b/lib/includes/Term.php
index e4b01a2..2f79c7e 100644
--- a/lib/includes/Term.php
+++ b/lib/includes/Term.php
@@ -3,7 +3,7 @@
 namespace Wikibase;
 
 use MWException;
-use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\LegacyIdInterpreter;
 
 /**
  * Object representing a term.
@@ -194,11 +194,9 @@
                if ( $entityType !== null && array_key_exists( 'entityId', 
$this->fields ) ) {
                        $numericId = $this->fields['entityId'];
 
-                       // FIXME: this is using the deprecated EntityId 
constructor and a hack to get the
-                       // correct EntityId type that will not work for entity 
types other then item and property.
-                       $entityId = new EntityId( $entityType, $numericId );
-                       $idParser = new BasicEntityIdParser();
-                       return $idParser->parse( $entityId->getSerialization() 
);
+                       // FIXME: this only works for items and properties
+                       $idParser = new LegacyIdInterpreter();
+                       return $idParser->newIdFromTypeAndNumber( $entityType, 
$numericId );
                }
 
                return null;

-- 
To view, visit https://gerrit.wikimedia.org/r/149224
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2d64795a790abf1095f8fe2fd885395cdb11cac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: WikidataJenkins <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to