Skip to content

Commit

Permalink
Order by the field(s) used to find duplicates
Browse files Browse the repository at this point in the history
When searching for duplicates, also sort the results by the
fields used to find the duplicates.
  • Loading branch information
samwilson committed Jul 15, 2019
1 parent 1d113c0 commit 7f6b60d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions admin/batch_manager_global.php
Expand Up @@ -651,10 +651,15 @@
$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 = '
Expand Down

0 comments on commit 7f6b60d

Please sign in to comment.