mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
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)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user