3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Set $preserve_keys argument to TRUE in both array_slice() calls.

This commit is contained in:
Michael Stenta 2021-05-27 14:05:48 -04:00
parent 596b8c8959
commit 9adf6ea30e

View file

@ -327,7 +327,7 @@ function farm_ui_views_sort_field(ViewExecutable $view, string $display_id, stri
$keys = array_keys($field_handlers);
$index = array_search($base_field_id, $keys, TRUE);
$pos = empty($index) ? count($field_handlers) : $index + 1;
$new_field_handlers = array_merge(array_slice($field_handlers, 0, $pos, TRUE), $new_field_handler, array_slice($field_handlers, $pos));
$new_field_handlers = array_merge(array_slice($field_handlers, 0, $pos, TRUE), $new_field_handler, array_slice($field_handlers, $pos, NULL, TRUE));
// Set the display to use the sorted field handlers.
$display->setOption($types[$type]['plural'], $new_field_handlers);