diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-03 17:03:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-03 17:06:36 +0100 |
commit | 47356c3b691738217cdfbbea163e576923e23e1a (patch) | |
tree | bfb0931112c9642f7b6a88b23a2d4e1bdfbbed60 | |
parent | 0f62373a064790c83ea69726e2d6933c5b7c41aa (diff) |
[UK] Fix issue with body_overrides.
Note how in road_not_found, the Highways England check could never pass
because the only_send was being removed the line before. When the
Buckinghamshire and Northamptonshire code was factored together, it
looks like bits were taken from one that weren't present in the other,
and so should not have been present in the shared code.
-rw-r--r-- | web/cobrands/buckinghamshire/assets.js | 4 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/assets.js | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/web/cobrands/buckinghamshire/assets.js b/web/cobrands/buckinghamshire/assets.js index 1cf5b236c..699588d98 100644 --- a/web/cobrands/buckinghamshire/assets.js +++ b/web/cobrands/buckinghamshire/assets.js @@ -285,6 +285,8 @@ fixmystreet.assets.add(defaults, { }; var msg_id = map[feature.attributes.feature_ty] || '#js-not-council-road'; + fixmystreet.body_overrides.allow_send(layer.fixmystreet.body); + fixmystreet.body_overrides.remove_only_send(); fixmystreet.message_controller.road_found(layer, feature, function(feature) { if (OpenLayers.Util.indexOf(bucks_types, feature.attributes.feature_ty) != -1) { var cat = $('select#form_category').val(); @@ -303,6 +305,8 @@ fixmystreet.assets.add(defaults, { }, not_found: function(layer) { + fixmystreet.body_overrides.do_not_send(layer.fixmystreet.body); + fixmystreet.body_overrides.remove_only_send(); fixmystreet.message_controller.road_not_found(layer); // If flytipping is picked, we don't want to ask the extra question diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js index 46d3323e5..5a25cc128 100644 --- a/web/cobrands/fixmystreet/assets.js +++ b/web/cobrands/fixmystreet/assets.js @@ -1177,8 +1177,6 @@ fixmystreet.message_controller = (function() { // then you should pass in a criterion function to test the found feature, // plus an ID of the message to be shown road_found: function(layer, feature, criterion, msg_id) { - fixmystreet.body_overrides.allow_send(layer.fixmystreet.body); - fixmystreet.body_overrides.remove_only_send(); if (fixmystreet.assets.selectedFeature()) { responsibility_off(); } else if (!criterion || criterion(feature)) { @@ -1191,12 +1189,10 @@ fixmystreet.message_controller = (function() { } }, + // If a feature wasn't found at the location they've clicked, it's + // probably a field or something. Show an error to that effect, + // unless an asset is selected. road_not_found: function(layer) { - // If a feature wasn't found at the location they've clicked, it's - // probably a field or something. Show an error to that effect, - // unless an asset is selected. - fixmystreet.body_overrides.do_not_send(layer.fixmystreet.body); - fixmystreet.body_overrides.remove_only_send(); // don't show the message if clicking on a highways england road if (fixmystreet.body_overrides.get_only_send() == 'Highways England' || !layer.visibility) { responsibility_off(); |