Order by the field(s) used to find duplicates

When searching for duplicates, also sort the results by the
fields used to find the duplicates.
This commit is contained in:
Sam Wilson
2018-08-10 18:11:37 +08:00
committed by Pierrick Le Gall
parent 551457f2b6
commit 05fb7aafd4
+7 -2
View File
@@ -651,10 +651,15 @@ if (count($page['cat_elements_id']) > 0)
$is_category = true;
}
// If using the 'duplicates' filter,
// order by the fields that are used to find duplicates.
if (isset($_SESSION['bulk_manager_filter']['prefilter'])
and 'duplicates' == $_SESSION['bulk_manager_filter']['prefilter'])
and 'duplicates' === $_SESSION['bulk_manager_filter']['prefilter']
and isset($duplicates_on_fields))
{
$conf['order_by'] = ' ORDER BY file, id';
// The $duplicates_on_fields variable is defined in ./batch_manager.php
$order_by_fields = array_merge( $duplicates_on_fields, array( 'id' ) );
$conf['order_by'] = ' ORDER BY '.join(', ', $order_by_fields);
}
$query = '