-
Notifications
You must be signed in to change notification settings - Fork 4
Issue 2 filebrowser.theme.inc uses deprecated function create_function() #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 2 filebrowser.theme.inc uses deprecated function create_function() #4
Conversation
…n() (correction) Remove create_function(); Replace inline style for file/folder icon with class 'icon' This fixes issue 2 related to deprecated php function create_function for php later than 7.2. Taken from patches provided for Drupal version of the module and adapted for Backdrop - see: https://www.drupal.org/project/filebrowser/issues/3061756 Also addresses separate issue related to display of file/folder icons: containing table cell (td) had width set as % and this is replaced by a class added to the cell. This is a corrected fix - first attempt introduced a typo on line 262
|
Line 262 now corrected. |
|
When showing a list of files and/or folders, clicking on any of the headings to sort doesn't work correctly. The display order changes, but it is hard to see what the order is - it's certainly not (say) alphabetical order of file or folder names. Same for Size and Date columns. This is not a problem in the unpatched version, so the cause is my fix. I'd value any insight into the cause by @argiepiano ... |
|
Patch submitted as
|
|
@nattywebdev it looks like your patch changes the assignment of $a and $b, which are used for comparison:
This is true for $b as well. While I haven't tried this myself, see if this solves your problem: $sorter = function ($a, $b) use ($field) {
$a = isset($a[$field]) ? $a[$field] : 0;
$b = isset($b[$field]) ? $b[$field] : 0;
return $a-$b;
};and $sorter = function ($a, $b) use ($field) {
$a = isset($a[$field]) ? $a[$field] : '';
$b = isset($b[$field]) ? $b[$field]: '';
return -strcmp(backdrop_strtolower($a), backdrop_strtolower($b));
}; |
|
I've made those changes and now the sorting works correctly. I've created another PR - or should it be an update to this one? |
|
@nattywebdev it's better to keep pushing changes to the same PR rather than open a new PR. At this point this is fine - you can go ahead and close this PR in favor of #6 |
|
Closing this in favor of #6 |
Remove create_function();
Replace inline style for file/folder icon with class 'icon'
This fixes issue 2 related to deprecated php function create_function for php later than 7.2.
Taken from patches provided for Drupal version of the module and adapted for Backdrop - see:
https://www.drupal.org/project/filebrowser/issues/3061756
Also addresses separate issue related to display of file/folder icons: containing table cell (td) had width set as % and this is replaced by a class added to the cell.