[TYPO3-formidable] renderlet:LISTER - Wrong sort order - Columns with numeric values get sorted wrong. I.e. 1, 15, 2, 3 instead of 1, 2, 3, 15

JéŽrô™me Schneider j.schneider at ameos.com
Fri May 7 17:35:12 CEST 2010


Hi Uwe,
I applied your patch in the SVN. It's available in revision 465.
Many thanks to you for providing the patch !

--

Have a nice week end,
Jérôme Schneider

Le 21/04/10 05:31, Uwe Schmelzer a écrit :
> Hi Jerome,
>
> You might give that one a try, whenever you may find the time, of course.
>
> 1. Found a very simple solution!
> ------------------------------------------------------------
> asort() could be replaced by natsort()
> arsort() could be replaced by natsort() and array_reverse
>
> Big Advantage:
> It works without additional sorting information in
> /columns/column/sort_mode
>
>
> 2. What to update
> ------------------------------------------------------------
> FILE EXT:ameos_formidable/api/base/ds_phparray/api/class.tx_dsphparray.php
> LINE 58 ff
>
> ORIGINAL CODE
>
> if($this->aConfig["sortdirection"] === "desc") {
> arsort($named_hash, $flags=0);
> } else {
> asort($named_hash, $flags=0);
> }
>
>
> SUGGESTED CODE
>
> if($this->aConfig["sortdirection"] === "desc") {
> natsort($named_hash);
> $named_hash = array_reverse($named_hash);
>
> } else {
> natsort($named_hash);
> }
>
>
>
> cheers
> uwe schmelzer



More information about the TYPO3-project-formidable mailing list