diff options
| author | Greg Roach <fisharebest@gmail.com> | 2021-04-22 13:37:48 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2021-04-22 13:38:35 +0100 |
| commit | 99be02de16e416f4dbf79370e4384609a5027948 (patch) | |
| tree | 5b7809fd62d36f714ba8d049c92485b982d53bf6 | |
| parent | 4d16af74f81038a082652e547e9f927fc2928652 (diff) | |
| download | webtrees-99be02de16e416f4dbf79370e4384609a5027948.tar.gz webtrees-99be02de16e416f4dbf79370e4384609a5027948.tar.bz2 webtrees-99be02de16e416f4dbf79370e4384609a5027948.zip | |
Show duplicate records in consistent order and with numbers
| -rw-r--r-- | app/Services/AdminService.php | 4 | ||||
| -rw-r--r-- | resources/views/admin/trees-duplicates.phtml | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/Services/AdminService.php b/app/Services/AdminService.php index 40c50819ed..901bb935ba 100644 --- a/app/Services/AdminService.php +++ b/app/Services/AdminService.php @@ -119,6 +119,7 @@ class AdminService ->groupBy(['s_name']) ->having(new Expression('COUNT(s_id)'), '>', '1') ->select([new Expression('GROUP_CONCAT(s_id) AS xrefs')]) + ->orderBy('xrefs') ->pluck('xrefs') ->map(static function (string $xrefs) use ($tree): array { return array_map(static function (string $xref) use ($tree): Source { @@ -139,6 +140,7 @@ class AdminService ->having(new Expression('COUNT(DISTINCT d_gid)'), '>', '1') ->select([new Expression('GROUP_CONCAT(DISTINCT d_gid ORDER BY d_gid) AS xrefs')]) ->distinct() + ->orderBy('xrefs') ->pluck('xrefs') ->map(static function (string $xrefs) use ($tree): array { return array_map(static function (string $xref) use ($tree): Individual { @@ -153,6 +155,7 @@ class AdminService ->groupBy([new Expression('GREATEST(f_husb, f_wife)')]) ->having(new Expression('COUNT(f_id)'), '>', '1') ->select([new Expression('GROUP_CONCAT(f_id) AS xrefs')]) + ->orderBy('xrefs') ->pluck('xrefs') ->map(static function (string $xrefs) use ($tree): array { return array_map(static function (string $xref) use ($tree): Family { @@ -167,6 +170,7 @@ class AdminService ->groupBy(['descriptive_title']) ->having(new Expression('COUNT(m_id)'), '>', '1') ->select([new Expression('GROUP_CONCAT(m_id) AS xrefs')]) + ->orderBy('xrefs') ->pluck('xrefs') ->map(static function (string $xrefs) use ($tree): array { return array_map(static function (string $xref) use ($tree): Media { diff --git a/resources/views/admin/trees-duplicates.phtml b/resources/views/admin/trees-duplicates.phtml index a8488be6c6..0b423d89c7 100644 --- a/resources/views/admin/trees-duplicates.phtml +++ b/resources/views/admin/trees-duplicates.phtml @@ -23,7 +23,7 @@ use Fisharebest\Webtrees\Tree; <h2><?= $category ?></h2> <?php if (!empty($records)) : ?> - <ul> + <ol> <?php foreach ($records as $duplicates) : ?> <li> <?= $duplicates[0]->fullName() ?> @@ -41,7 +41,7 @@ use Fisharebest\Webtrees\Tree; <?php endif ?> </li> <?php endforeach ?> - </ul> + </ol> <?php else : ?> <p><?= I18N::translate('No duplicates have been found.') ?></p> <?php endif ?> |
