Skip to content

Commit

Permalink
[BUGFIX] Fix sorting in FileBrowser
Browse files Browse the repository at this point in the history
Apply sorting params passed in the request
to the element browser filelist.

Resolves: #100949
Releases: main, 12.4
Change-Id: I60244c66f481ce26f03d672754935dd7902befc7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79919
Tested-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
pixeldesu authored and bnf committed Jul 10, 2023
1 parent 9613736 commit ccc30d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion typo3/sysext/filelist/Classes/ElementBrowser/FileBrowser.php
Expand Up @@ -119,7 +119,13 @@ public function render()
$markup[] = '</div>';

// Create the filelist
$this->filelist->start($this->selectedFolder, MathUtility::forceIntegerInRange($this->currentPage, 1, 100000), 'asc', false, Mode::BROWSE);
$this->filelist->start(
$this->selectedFolder,
MathUtility::forceIntegerInRange($this->currentPage, 1, 100000),
$this->getRequest()->getQueryParams()['sort'] ?? 'asc',
($this->getRequest()->getQueryParams()['reverse'] ?? '') === '1',
Mode::BROWSE
);
$this->filelist->setResourceDisplayMatcher($this->resourceDisplayMatcher);
$this->filelist->setResourceSelectableMatcher($this->resourceSelectableMatcher);
$searchDemand = $this->searchWord !== ''
Expand Down

0 comments on commit ccc30d4

Please sign in to comment.