Skip to content

editedBy item sort option for group libraries#154

Open
abaevbog wants to merge 3 commits into
zotero:masterfrom
abaevbog:sort_option_for_group_libs
Open

editedBy item sort option for group libraries#154
abaevbog wants to merge 3 commits into
zotero:masterfrom
abaevbog:sort_option_for_group_libs

Conversation

@abaevbog
Copy link
Copy Markdown
Contributor

Fixes: #153

@abaevbog abaevbog requested a review from dstillman June 22, 2023 20:23
Comment thread controllers/ApiController.php Outdated
// Sorting by Item Type or Added By currently require writing to shard tables, so don't
// send those to the read replicas
if ($this->queryParams['sort'] == 'itemType' || $this->queryParams['sort'] == 'addedBy') {
if ($this->queryParams['sort'] == 'itemType' || $this->queryParams['sort'] == 'addedBy' || $this->queryParams['sort'] == 'editedBy') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can switch this to in_array($this->queryParams['sort'], ['itemType', 'addedBy', 'editedBy'])

Comment thread model/Items.inc.php


case 'editedBy':
case 'addedBy':
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editedBy goes second, here and below

Comment thread model/Items.inc.php Outdated
case 'editedBy':
case 'addedBy':
$isGroup = Zotero_Libraries::getType($libraryID) == 'group';
$userParameter = $params['sort'] == "editedBy" ? 'lastModifiedByUserID' : 'createdByUserID';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use == 'addedBy' instead

@abaevbog abaevbog requested a review from dstillman June 23, 2023 15:32
abaevbog added a commit to abaevbog/dataserver that referenced this pull request Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

editedBy item sort option for group libraries

2 participants