Addshore has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78808


Change subject: Get rid of deprecated method in GetEntities
......................................................................

Get rid of deprecated method in GetEntities

Change-Id: I753de50467924067307883969bb7520cd4cc4876
---
M repo/includes/api/GetEntities.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/08/78808/1

diff --git a/repo/includes/api/GetEntities.php 
b/repo/includes/api/GetEntities.php
index 00963df..64ca636 100644
--- a/repo/includes/api/GetEntities.php
+++ b/repo/includes/api/GetEntities.php
@@ -135,6 +135,7 @@
                wfProfileIn( __METHOD__ );
 
                $entityContentFactory = EntityContentFactory::singleton();
+               $entityIdFormatter = 
WikibaseRepo::getDefaultInstance()->getEntityIdFormatter();
 
                $res = $this->getResult();
 
@@ -151,7 +152,7 @@
                //FIXME: if we get different kinds of entities at once, 
$entityId->getNumericId() may not be unique.
                $entityPath = array(
                        'entities',
-                       $this->getUsekeys() ? $entityId->getPrefixedId() : 
$entityId->getNumericId()
+                       $this->getUsekeys() ? $entityIdFormatter->format( 
$entityId ) : $entityId->getNumericId()
                );
 
                // later we do a getContent but only if props are defined
@@ -169,7 +170,7 @@
                                // this should not happen unless a page is not 
what we assume it to be
                                // that is, we want this to be a little more 
solid if something ges wrong
                                if ( is_null( $entityContent ) ) {
-                                       $res->addValue( $entityPath, 'id', 
$entityId->getPrefixedId() );
+                                       $res->addValue( $entityPath, 'id', 
$entityIdFormatter->format( $entityId ) );
                                        $res->addValue( $entityPath, 'illegal', 
"" );
                                        return;
                                }
@@ -210,7 +211,7 @@
                                $res->addValue( $entityPath, 'missing', "" );
                        }
                } else {
-                       $res->addValue( $entityPath, 'id', 
$entityId->getPrefixedId() );
+                       $res->addValue( $entityPath, 'id', 
$entityIdFormatter->format( $entityId ) );
                        $res->addValue( $entityPath, 'type', 
$entityId->getEntityType() );
                }
                wfProfileOut( __METHOD__ );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I753de50467924067307883969bb7520cd4cc4876
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to