Project

General

Profile

Actions

Bug #19964

closed

Files in linkpopup should have sorting by ABC

Added by Sonja Schubert almost 16 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-02-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Files in linkpopup should have sorting by ABC, currently its mixed up.

When you want to link something in RTE with a file, then you click on the world icon and choose the file section. When you select a directory with a lot of files it is not simple to find the right file, when the list has no sorting.

rtehtmlarea 1.7.5
TYPO3 4.2.1
(issue imported from #M10340)


Files

screenshot_10340.png (8.23 KB) screenshot_10340.png Administrator Admin, 2009-07-17 12:05
Actions #1

Updated by Stanislas Rolland over 15 years ago

RTE uses expandFolder from base class browselinks.

The files are sorted in increasing alphabetic order by t3lib_div::getFilesInDir.

Perhaps the problem is due to locale sorting?

In what language are the filenames?

t3lib_div::getFilesInDir uses asort. Perhaps it should use uasort($sortarray, 'strcoll') ?

Actions #2

Updated by Stanislas Rolland over 15 years ago

Moving this issue to general core issues as it is not specific to htmlArea RTE.

Actions #3

Updated by Sonja Schubert over 15 years ago

The Backend language isset to German, but the problem occurs also with BE language set to English.
The filenames are english and german mixed.

I attached a screenshot, where you can see the wrong sorting in the link popup.

Actions #4

Updated by Steffen Müller over 15 years ago

In your screenshot sorting is following ASCII order, with uppercase characters leading lowercase ones.
This is what t3lib_div.getFilesInDir() does when using asort() without a sorting order flag: http://typo3.org/fileadmin/typo3api-4.0.0/d6/d99/class_8t3lib__div_8php-source.html#l02552

To get files sorted in an case insensitive order, asort needs an additional flag called SORT_LOCALE_STRING

- asort($sortarray);
+ asort($sortarray, SORT_LOCALE_STRING);

Please try, because I didn't.

Wheater the sorting is wrong or not is a matter of taste. So I'd plead for an optional change.

Actions #5

Updated by Steffen Müller over 15 years ago

While we are at it:
Another option to first sort by filename extension and afterwards by filename would be appreciated.

Actions #6

Updated by Sonja Schubert almost 15 years ago

Bug is fixed in 4.3.1 so for me, this bug report could be closed.

Actions

Also available in: Atom PDF