The latest dev, Sept 7, has something wrong with sorting. It is all messed up, does not seem to matter what column you sort on, it comes up out of order. Attached are screen caps.

Thx

Rob

Comments

Yoran’s picture

StatusFileSize
new38.65 KB

Can you tell me which version of PHP are you using ? Sort is done by "on the flight" sorter function creation. It's working perfectly (as you can see in attachements) on my test platform (GNU/Linux - PHP 5.3.2) but I have more and more doubts about this technique.

Yoran’s picture

Status: Active » Postponed
greywolfsspirit’s picture

Yoran,
I too am seeing this behavior as well, even after the php update to 5.2.11.

Not too sure where the problem would be, unless it's something having to do with the string length, sorting things like 2, 2950, 5, 1500 in a way like this

1500
2
2950
5

sorting on the first digit only, regardless of the length of the values. Dates would be sorted by the first letter of the day (ex: Monday, Tuesday...)

Maybe this gives you a few ideas as to where it might be going a little screwy, but this seems to be the pattern I am seeing so far.

Yoran’s picture

Status: Postponed » Fixed

Well, very stupid bug of mine. Corrected in next dev.

greywolfsspirit’s picture

out of curiosity, what was the bug? Just what I thought?

Yoran’s picture

A real stupid one. In the generated sort function, I ended up extracting the same field twice. Sometime I just hate PHP for not warning me about such simple thing. I activated all PHP notice but it seems not to work on function created at runtime, cool.

greywolfsspirit’s picture

ahh.. okay..

asb’s picture

StatusFileSize
new22.15 KB

I don't want to hijack this issue, so just mentioning: Sorting doesn't work at all for me (latest dev release), neither when clicking on the "Display name" column header, nor throught the "Folder presentation" setting. Attaching screenshot for illustrative purposes.

Yoran’s picture

If it doesn't work, it doesn't work, don't worry about hijacking anything. Else I'll be sorry about the time you spent testing this module and giving me feedbacks.

Is it possible for you ton insert, before line 231 bin filebrowser.theme.inc

        ...
        }
        var_dump(array($field, $code)); exit();
        $sorter = create_function('$a,$b', $code);
        ...

And give me what you have in your browser on next F5 (don't forget to remove this line after).

asb’s picture

array(2) { [0]=> string(12) "display-name" [1]=> string(148) "$a=isset($a["display-name"])?$a["display-name"]:"";$b=isset($b["display-name"])?$b["display-name"]:"";return -strcmp(strtolower($a),strtolower($b));" }

Does this help you?

asb’s picture

array(2) { [0]=> string(12) "display-name" [1]=> string(148) "$a=isset($a["display-name"])?$a["display-name"]:"";$b=isset($b["display-name"])?$b["display-name"]:"";return -strcmp(strtolower($a),strtolower($b));" }

Does this help you?

Yoran’s picture

wonderfull, so the function is perfectly correct :/ And you you have no error in your traces (error.log) ? Is the problem the same with created (integer) column ?

Yoran’s picture

Status: Fixed » Active
Yoran’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.