From 7ab7e4ffe09f99ecb4361aa5f594f6bdb291823a Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Wed, 21 Oct 2020 11:58:00 -0400 Subject: [PATCH 1/7] Don't warn about deprecated tags that would overwrite existing data when upgraded (close #7843) --- modules/osm/entity.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/osm/entity.js b/modules/osm/entity.js index 2714672af..46e3b261b 100644 --- a/modules/osm/entity.js +++ b/modules/osm/entity.js @@ -198,6 +198,17 @@ osmEntity.prototype = { var deprecated = []; dataDeprecated.forEach(function(d) { var oldKeys = Object.keys(d.old); + if (d.replace) { + var hasExistingValues = Object.keys(d.replace).some(function(replaceKey) { + if (!tags[replaceKey] || d.old[replaceKey]) return false; + var replaceValue = d.replace[replaceKey]; + if (replaceValue === '*') return false; + if (replaceValue === tags[replaceKey]) return false; + return true; + }); + // don't flag deprecated tags if the upgrade path would overwrite existing data - #7843 + if (hasExistingValues) return; + } var matchesDeprecatedTags = oldKeys.every(function(oldKey) { if (!tags[oldKey]) return false; if (d.old[oldKey] === '*') return true; From 99efc8b2a408a78c64a8f733a90461867e7fc718 Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Wed, 21 Oct 2020 12:59:57 -0400 Subject: [PATCH 2/7] Update changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2affccf4..c4b2b485b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ or learn more by visiting our project page on GitHub: :octocat: https://github. If you love iD, please star our project on GitHub to show your support! :star: -_Breaking changes, which may affect downstream projects or sites that embed iD, are marked with a_ :warning: +_Breaking developer changes, which may affect downstream projects or sites that embed iD, are marked with a_ :warning: