From 4fb292a7773ba275b9edab5baa15a8d14e59902f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 22 Jul 2015 10:11:23 +0930 Subject: [PATCH] Always use default includes when preloading discussion list Making them explicit causes problems when extensions want to include something by default (e.g. tags) --- src/Api/Actions/Discussions/IndexAction.php | 6 +++--- src/Forum/Actions/IndexAction.php | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Api/Actions/Discussions/IndexAction.php b/src/Api/Actions/Discussions/IndexAction.php index 870c7051f..c48f728fa 100644 --- a/src/Api/Actions/Discussions/IndexAction.php +++ b/src/Api/Actions/Discussions/IndexAction.php @@ -32,9 +32,9 @@ class IndexAction extends SerializeCollectionAction 'lastUser' => true, 'startPost' => false, 'lastPost' => false, - 'relevantPosts' => false, - 'relevantPosts.discussion' => false, - 'relevantPosts.user' => false + 'relevantPosts' => true, + 'relevantPosts.discussion' => true, + 'relevantPosts.user' => true ]; /** diff --git a/src/Forum/Actions/IndexAction.php b/src/Forum/Actions/IndexAction.php index 51505ffe0..f7d1cef2a 100644 --- a/src/Forum/Actions/IndexAction.php +++ b/src/Forum/Actions/IndexAction.php @@ -10,8 +10,8 @@ class IndexAction extends ClientAction * @var array */ protected $sortMap = [ - 'recent' => '-lastTime', - 'replies' => '-commentsCount', + 'latest' => '-lastTime', + 'top' => '-commentsCount', 'newest' => '-startTime', 'oldest' => '+startTime' ]; @@ -30,8 +30,7 @@ class IndexAction extends ClientAction $params = [ 'sort' => $sort ? $this->sortMap[$sort] : '', - 'filter' => ['q' => $q], - 'include' => $q ? 'startUser,lastUser,relevantPosts,relevantPosts.discussion,relevantPosts.user' : '' + 'filter' => ['q' => $q] ]; // FIXME: make sure this is extensible. Support pagination.