Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Replace (int)substr( … ) hack with getNumericId()
......................................................................

Replace (int)substr( … ) hack with getNumericId()

Change-Id: I23d4df324bdd06f1e097235aa78a23a3b459af0a
---
M src/Services/FilePageLookup.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseMediaInfo 
refs/changes/01/297401/1

diff --git a/src/Services/FilePageLookup.php b/src/Services/FilePageLookup.php
index 440a600..bd1b358 100644
--- a/src/Services/FilePageLookup.php
+++ b/src/Services/FilePageLookup.php
@@ -32,8 +32,7 @@
         * the given MediaInfo, or null if there is no such page.
         */
        public function getFilePage( MediaInfoId $mediaInfoId ) {
-               // TODO: Fix this hack. $mediaInfoId should have getNumericId() 
(or getPageId()).
-               $pageId = (int)substr( $mediaInfoId->getSerialization(), 1 );
+               $pageId = $mediaInfoId->getNumericId();
 
                try {
                        $filePageTitle = $this->titleFactory->newFromID( 
$pageId );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23d4df324bdd06f1e097235aa78a23a3b459af0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseMediaInfo
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

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

Reply via email to