EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/171973
Change subject: Bug: User sorting options not taken into account via API
......................................................................
Bug: User sorting options not taken into account via API
Change-Id: I166059834c870f20e324a29bf66c498a65715faf
---
M includes/Block/TopicList.php
M includes/api/ApiFlowViewTopicList.php
2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/73/171973/1
diff --git a/includes/Block/TopicList.php b/includes/Block/TopicList.php
index 43a0b03..ad7d212 100644
--- a/includes/Block/TopicList.php
+++ b/includes/Block/TopicList.php
@@ -267,7 +267,7 @@
// To clear the sortby user preference, pass sortby with an
empty value
$sortByOption = '';
$user = $this->context->getUser();
- if ( isset( $requestOptions['sortby'] ) ) {
+ if ( isset( $requestOptions['sortby'] ) &&
$requestOptions['sortBy'] !== '' ) {
if ( $requestOptions['sortby'] === 'updated' ) {
$sortByOption = 'updated';
}
diff --git a/includes/api/ApiFlowViewTopicList.php
b/includes/api/ApiFlowViewTopicList.php
index 327ab30..b28b1eb 100644
--- a/includes/api/ApiFlowViewTopicList.php
+++ b/includes/api/ApiFlowViewTopicList.php
@@ -27,8 +27,9 @@
ApiBase::PARAM_DFLT => 'fwd',
),
'sortby' => array(
- ApiBase::PARAM_TYPE => array( 'newest',
'updated' ),
- ApiBase::PARAM_DFLT => 'newest',
+ // blank string means use user setting,
defaults to newest
+ ApiBase::PARAM_TYPE => array( 'newest',
'updated', '' ),
+ ApiBase::PARAM_DFLT => '',
),
'savesortby' => array(
ApiBase::PARAM_TYPE => 'boolean',
--
To view, visit https://gerrit.wikimedia.org/r/171973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I166059834c870f20e324a29bf66c498a65715faf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits