Way to deduplicate geo entites

Created on 26 February 2023, almost 2 years ago
Updated 4 February 2024, 12 months ago

Problem/Motivation

https://github.com/localgovdrupal/localgov_geo/issues/58

Our migration has brought in a lot of duplicate geo entities, is there a way of deduplicating them?
This would be:

  • Find duplicate geos (may need some fuziness, as some didn't get the lat long exactly right)
  • Reassign the target_ids on the directory venues.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands ekes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ekes
  • 🇳🇱Netherlands ekes

    In a migration it might be as easy to do it on the way in. But in use I've seen it that people end up making dupes; and it would be good to merge them.

    Would a Bulk Operation do it?
    With knowing the field that references the entity (geo entity location field) the bulk operation could delete all but the first selected geo entity; it could re-assign all references in the field to the deleted entities to the remaining first one. Assumption: the bulk operation gets the items in the sort order. It'd be a bit of a documentation thing to describe that you need to make sure the first in the sort order has the correct data. Have to think about what to do with revisions too. For the rest I think that's a plausible option?

  • 🇳🇱Netherlands ekes

    I made some code to help the backend of this https://www.drupal.org/project/referenced_entity_replace

Production build 0.71.5 2024