From e66cab06ebd6302d6c70333586e5cad39dd82b9a Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Thu, 25 Jul 2024 18:13:27 +0200 Subject: [PATCH] update all relation parents of an entity, fixes #10342 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this had regressed in 5f1e405 – if an entity had two or more parent relations, the loop would abort after the first parent relation because `memo[entity.id]` would be set to true in the first parent iteration. what we want is to only abort if the same `relation` is seen again (in a r123 [-> …] -> r123 cirular relationship) --- CHANGELOG.md | 2 ++ modules/core/tree.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa3d58169..9fbb31c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ _Breaking developer changes, which may affect downstream projects or sites that * Only consider features with either `landuse`, `natural`, `amentiy` or `leisure` tag to be classified as _Landuse_ areas * Fix address field overwriting existing data when switching selected map features under certain circumstances ([#10260]) * Show `name` field also when only a localized name is present (e.g. only `name:xy`, but not `name`) and the preset does not show the name field by default ([#10323], thanks [@samhoooo]) +* Fix bug which in some cases prevented the list of relations in _raw membership editor_ from showing all relations in the visible map area ([#10342]) #### :earth_asia: Localization * Add address format for Thailand ([#10291], thanks [@cmoffroad]) #### :hourglass: Performance @@ -78,6 +79,7 @@ _Breaking developer changes, which may affect downstream projects or sites that [#10291]: https://github.com/openstreetmap/iD/pull/10291 [#10302]: https://github.com/openstreetmap/iD/issues/10302 [#10323]: https://github.com/openstreetmap/iD/issues/10323 +[#10342]: https://github.com/openstreetmap/iD/issues/10342 [@zbycz]: https://github.com/zbycz [@samhoooo]: https://github.com/samhoooo [@cmoffroad]: https://github.com/cmoffroad diff --git a/modules/core/tree.js b/modules/core/tree.js index 44496d420..3d92bd880 100644 --- a/modules/core/tree.js +++ b/modules/core/tree.js @@ -76,8 +76,8 @@ export function coreTree(head) { }); head.parentRelations(entity).forEach(function(relation) { - if (memo[entity.id]) return; - memo[entity.id] = true; + if (memo[relation.id]) return; + memo[relation.id] = true; if (_bboxes[relation.id]) { removeEntity(relation); insertions[relation.id] = relation;