From a46a345647920c51a9953e193ff0d74e7f8e71b9 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 5 Aug 2021 14:49:14 -0400 Subject: [PATCH] Only expand a validation set to include parent multipolygon relations The previous code was grabbing _all_ parent relations, which is too much. For example: if a user changed a road, the validator was treating it like the user had changed bus and highway routes along that road. (closes #8613) (helps a lot #8612) --- modules/core/validator.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/core/validator.js b/modules/core/validator.js index a95d5faf7..b2cd289da 100644 --- a/modules/core/validator.js +++ b/modules/core/validator.js @@ -650,7 +650,7 @@ export function coreValidator(context) { checkParentRels.push(parentWay); }); - } else if (entity.type === 'relation') { + } else if (entity.type === 'relation' && entity.isMultipolygon()) { entity.members.forEach(member => collected.add(member.id)); // collect members } else if (entity.type === 'way') { @@ -662,7 +662,11 @@ export function coreValidator(context) { checkParentRels.forEach(entity => { // collect parent relations if (entity.type !== 'relation') { // but not super-relations - graph.parentRelations(entity).forEach(parentRelation => collected.add(parentRelation.id)); + graph.parentRelations(entity).forEach(parentRelation => { + if (parentRelation.isMultipolygon()) { + collected.add(parentRelation.id); + } + }); } }); });