jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/379702 )

Change subject: Fix type conversion bug
......................................................................


Fix type conversion bug

And also some small type / code style issues while we are at it.

Change-Id: Ic5a62b2665b2b25fc270770c3d9db088bcc9fd00
---
M src/Api/ApiQueryReadingLists.php
M src/Api/ApiTrait.php
M src/ReadingListRepository.php
3 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Krinkle: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Mholloway: Looks good to me, approved



diff --git a/src/Api/ApiQueryReadingLists.php b/src/Api/ApiQueryReadingLists.php
index 2a0ff1b..68c9d89 100644
--- a/src/Api/ApiQueryReadingLists.php
+++ b/src/Api/ApiQueryReadingLists.php
@@ -190,14 +190,14 @@
 
        /**
         * Transform a row into an API result item
-        * @param ReadingListRow $row
+        * @param ReadingListRow $row List row, with additions from 
addExtraData().
         * @param string $mode One of the MODE_* constants.
         * @return array
         */
        private function getResultItem( $row, $mode ) {
                $item = [
                        'id' => (int)$row->rl_id,
-                       'name' => (int)$row->rl_name,
+                       'name' => $row->rl_name,
                        'default' => (bool)$row->rl_is_default,
                        'description' => $row->rl_description,
                        'color' => $row->rl_color,
diff --git a/src/Api/ApiTrait.php b/src/Api/ApiTrait.php
index 4af09f5..df2e7c9 100644
--- a/src/Api/ApiTrait.php
+++ b/src/Api/ApiTrait.php
@@ -40,7 +40,7 @@
         */
        public static function factory( ApiBase $parent, $name ) {
                $services = MediaWikiServices::getInstance();
-               $loadBalancerFactory = $services ->getDBLoadBalancerFactory();
+               $loadBalancerFactory = $services->getDBLoadBalancerFactory();
                $dbw = Utils::getDB( DB_MASTER, $services );
                $dbr = Utils::getDB( DB_REPLICA, $services );
                if ( static::$prefix ) {
diff --git a/src/ReadingListRepository.php b/src/ReadingListRepository.php
index c657907..4bd7e89 100644
--- a/src/ReadingListRepository.php
+++ b/src/ReadingListRepository.php
@@ -531,7 +531,7 @@
                if ( !$ids ) {
                        throw new ReadingListRepositoryException( 
'readinglists-db-error-not-set-up' );
                }
-               return $ids;
+               return array_map( 'intval', $ids );
        }
 
        /**
@@ -645,7 +645,7 @@
                        }
                }
 
-               return $ids;
+               return array_map( 'intval', $ids );
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic5a62b2665b2b25fc270770c3d9db088bcc9fd00
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ReadingLists
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to