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

Change subject: I should be able to view other users public lists
......................................................................


I should be able to view other users public lists

Bug: T92543
Change-Id: Iecab1d22a3df8b5da693a30d4a6aacf4d8f8afec
---
M includes/models/Collection.php
M includes/models/CollectionsList.php
M includes/specials/SpecialGather.php
3 files changed, 6 insertions(+), 9 deletions(-)

Approvals:
  Yurik: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/models/Collection.php b/includes/models/Collection.php
index 2c4871a..1b920d2 100644
--- a/includes/models/Collection.php
+++ b/includes/models/Collection.php
@@ -112,6 +112,7 @@
                                $collection = self::newFromCollectionInfo( $c );
                        }
                }
+
                if ( $collection ) {
                        $api = new ApiMain( new FauxRequest( array(
                                'action' => 'query',
diff --git a/includes/models/CollectionsList.php 
b/includes/models/CollectionsList.php
index c31cd4a..cd787a6 100644
--- a/includes/models/CollectionsList.php
+++ b/includes/models/CollectionsList.php
@@ -90,8 +90,9 @@
                $api = new ApiMain( new FauxRequest( array(
                        'action' => 'query',
                        'list' => 'lists',
-                       'lstprop' => 'label|description|public|count',
+                       'lstprop' => 'label|description|public|image|count',
                        'continue' => '',
+                       'lstowner' => $user->getName(),
                ) ) );
                $api->execute();
                $data = $api->getResultData();
diff --git a/includes/specials/SpecialGather.php 
b/includes/specials/SpecialGather.php
index dc87a89..e1f8b2d 100644
--- a/includes/specials/SpecialGather.php
+++ b/includes/specials/SpecialGather.php
@@ -83,18 +83,14 @@
         * @param int $id collection id
         */
        public function renderUserCollection( User $user, $id ) {
-               $collection = null;
-               // FIXME: It should be possible to view public lists by other 
user. Limitated by API.
-               if ( $this->isOwner( $user ) ) {
-                       $collection = models\Collection::newFromApi( $id, $user 
);
-               }
+               $collection = models\Collection::newFromApi( $id, $user );
 
                if ( $collection === null ||
                        ( !$collection->isPublic() && !$this->isOwner( $user ) 
) ) {
                        // FIXME: No permissions to visit this. Showing not 
found ATM.
                        $this->renderError( new views\NotFound() );
                } else {
-                       $this->render( new views\Collection( $this->getUser(), 
$collection ) );
+                       $this->render( new views\Collection( $user, $collection 
) );
                }
        }
 
@@ -105,8 +101,7 @@
         */
        public function renderUserCollectionsList( User $user ) {
                $collectionsList = models\CollectionsList::newFromApi( $user, 
$this->isOwner( $user ) );
-               // FIXME: Remove when CollectionsList::newFromApi supports 
access of other peoples lists
-               if ( $this->isOwner( $user ) && $collectionsList->getCount() > 
0 ) {
+               if ( $collectionsList->getCount() > 0 ) {
                        $this->render( new views\CollectionsList( 
$collectionsList ) );
                } else {
                        $this->renderError( new views\NoPublic() );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iecab1d22a3df8b5da693a30d4a6aacf4d8f8afec
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Robmoen <rm...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Yurik <yu...@wikimedia.org>
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