I got the following error after updating to 2.0-rc12 when sorting by display name:

* warning: usort() [function.usort]: Invalid comparison function. in /var/www/sites/all/modules/filebrowser/filebrowser.theme.inc on line 201.
* warning: usort() [function.usort]: Invalid comparison function. in /var/www/sites/all/modules/filebrowser/filebrowser.theme.inc on line 205.

Changing "display-name" in filebrowser.common.inc on line 47 to "display_name" fixed the problem.

Comments

Carlos Miranda Levy’s picture

Thanks!
This fixed the problem of the file list not being sorted by display name.
I confirm this change (display-name should be left unchanged everywhere else it appears) fixes this issue, at least with PHP 5.3 and filebrowser 2.0-rc12.
Thanks again, I spent 2 hours trying to figure out why sorting was not working for me.

Yoran’s picture

Status: Active » Fixed

Actually this is not enough to fix as this constant (line 47) is used in many place. Changing like that will fix the sort but break lot of stuff.

As the sorter design was definitely wrong, specially with new metadata API, I rewrote this part. It's commited in dev, tell me if this is ok for you when the tarball is ready.

Yoran’s picture

Version: 6.x-2.0-rc12 » 6.x-2.x-dev
dum3r’s picture

I've have same warning after updating from r10 to r12 and dev

warning: usort() expects parameter 2 to be a valid callback, no array or string given in /var/www/drupal-6.17/sites/all/modules/filebrowser/filebrowser.theme.inc on line 219.
warning: usort() expects parameter 2 to be a valid callback, no array or string given in /var/www/drupal-6.17/sites/all/modules/filebrowser/filebrowser.theme.inc on line 223.

Warning is gone only if i remove 'Display name', 'Description' from showed fields' list

glottus’s picture

Trying to use the dev version, but still getting the usort() warning if any sort argument is present, or if Display Name is used.

Since switching to dev, I also get "Parse error: parse error in ....\filebrowser.theme.inc(218) : runtime-created function on line 1" and the same for filebrowser.theme.inc(223).

tjharman’s picture

Is there a version of this module ATM at works?
The "release candidate" gives me errors, as does the development version.

Does anyone have a link to a stable working version?

bgilday’s picture

subscribing

dum3r’s picture

Status: Fixed » Active

may be we should change status to 'active' from 'fixed'

greywolfsspirit’s picture

Also getting this same error, running the dev version released Jul 11, 2010.

Parse error: parse error in C:\wamp\www\sites\all\modules\filebrowser\filebrowser.theme.inc(218) : runtime-created function on line 1

Parse error: parse error in C:\wamp\www\sites\all\modules\filebrowser\filebrowser.theme.inc(223) : runtime-created function on line 1

greywolfsspirit’s picture

Another bug I spotted, is, if your filename or directory name has a Space or an & or a # sign, you have to manually edit the descript.ion file and put " " around the filename/directory name for it to show up in the metadata section. The filter is not allowing these to be displayed as is. I have many files that use an & in them and a lot with spaces as well. Can we get this looked into to allow files with these scenerios to not filter out these characters?

DruKaz’s picture

StatusFileSize
new122.92 KB

@greywolfsspirit: it's better if you report that bug in a new issue. That way, it's easier for the developer to spot and to see what still needs to be done.

For the ones that want to revert to a previous (working) version:
I was lucky enough to have recently backed-up my entire site again. So I still have the dev-version of march 31 wich isn't affected by the bug.

Note: if you get an error after reverting to this version, run update.php again (wich you should actually always do)

greywolfsspirit’s picture

Checking to see if anyone has made progress on a patch to get this working correctly yet.

glottus’s picture

For now, I'm using the previous version that DruKaz provided in #11. That's working for me.

ak’s picture

subscribing

greywolfsspirit’s picture

Just checking to see if you had a chance to look into this, Yoran? Haven't seen any updates since Jul 11th, and with the issues, I've been forced to sit back and wait on someone to figure out a fix on this. Thanks. Currently using the dev copy posted in #11.

tlogan’s picture

subscribing

hovemt’s picture

Version: 6.x-2.x-dev » 6.x-2.0-rc12
StatusFileSize
new820 bytes

I made a patch on filebrowser.theme.inc on lines 201 and 205. It parses the name of the sort to a function, and if there is a dash in the name, which is there for display-name the function doesn't get called. I did put in a strtr to translate the dash into an underscore.

I don't know if I made the patch correctly, so let me know if it's not working.

Yoran’s picture

Status: Active » Fixed

Sorry I'm late :/ As this is a no so big module with not so many users, you can ping me by using contact form when your stuck like this ! The developer interface for this issue system is very difficult to follow if you don't open the issues page regularly.

Anyway this should be fixed in last dev version.

Status: Fixed » Closed (fixed)

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

fess’s picture

Thanks! very helpful!

jdelgama’s picture

Aplied filebrowser.theme_.inc_.patch and it worked for me!
Thanks!