aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-04 13:44:44 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-04 13:44:44 +0000
commit47befd5dcbb3fefc6c4d99b65ee125275c3d8509 (patch)
treece044d191ef664333251d5571cedf41fe3b7565a
parentda683b48aac5e43321d097f127fa5e09b35badd6 (diff)
parente0ae38e1ebc35fc5346e7f1ee7da66a9cc60d753 (diff)
Merge branch '2369-admin-list-field-bug'
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/Cobrand/BathNES.pm3
-rw-r--r--templates/web/base/admin/extra-metadata-form.html2
-rw-r--r--templates/web/base/common_header_tags.html2
-rw-r--r--templates/web/base/common_scripts.html2
-rw-r--r--web/cobrands/fixmystreet/admin.js2
6 files changed, 7 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d176fbbd7..631dc3097 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
- Remove any use of `my $x if $foo`. #2377
- Fix saving of inspect form data offline.
- Add CSRF and time to contact form.
+ - Make sure admin metadata dropdown index numbers are updated too.
* v2.5 (21st December 2018)
- Front end improvements:
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm
index 025648591..800ca88fa 100644
--- a/perllib/FixMyStreet/Cobrand/BathNES.pm
+++ b/perllib/FixMyStreet/Cobrand/BathNES.pm
@@ -96,8 +96,9 @@ sub default_show_name { 0 }
sub default_map_zoom { 3 }
sub map_js_extra {
- my ($self, $c) = @_;
+ my $self = shift;
+ my $c = $self->{c};
return unless $c->user_exists;
my $banes_user = $c->user->from_body && $c->user->from_body->areas->{$self->council_area_id};
diff --git a/templates/web/base/admin/extra-metadata-form.html b/templates/web/base/admin/extra-metadata-form.html
index 9264d98d9..4fc5d8e3f 100644
--- a/templates/web/base/admin/extra-metadata-form.html
+++ b/templates/web/base/admin/extra-metadata-form.html
@@ -12,7 +12,7 @@
<div class="admin-hint"><p>[% loc('Whether the field is displayed to the user, included as a hidden field and automatically populated, or set by the server upon Open311 submission. This field is usually set automatically.') %]</p></div>
<label>
[% loc('Automated') %]
- <select name="metadata[[% loop.index %]].automated" data-field-name="automated" class="js-metadata-item-type">
+ <select name="metadata[[% loop.index %]].automated" data-field-name="automated">
<option value="" [% meta.automated == '' ? 'selected' : '' %]></option>
<option value="server_set" [% meta.automated == 'server_set' ? 'selected' : '' %]>[% loc('Server Set') %]</option>
<option value="hidden_field" [% meta.automated == 'hidden_field' ? 'selected' : '' %]>[% loc('Hidden Field') %]</option>
diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html
index 21081246d..e29d96655 100644
--- a/templates/web/base/common_header_tags.html
+++ b/templates/web/base/common_header_tags.html
@@ -38,7 +38,7 @@
<link rel="prefetch" href="[% version('/cobrands/fixmystreet/fixmystreet.js') %]">
[% END %]
[% IF NOT bodyclass.match('mappage') %]
- [% FOR script IN map_js.merge(c.cobrand.call_hook('map_js_extra', c)) %]
+ [% FOR script IN map_js.merge(c.cobrand.call_hook('map_js_extra')) %]
<link rel="prefetch" href="[% IF script.match('^/'); version(script); ELSE; script; END %]">
[% END %]
<link rel="prefetch" href="[% version('/cobrands/fixmystreet/map.js') %]">
diff --git a/templates/web/base/common_scripts.html b/templates/web/base/common_scripts.html
index ac66aad46..fd7011763 100644
--- a/templates/web/base/common_scripts.html
+++ b/templates/web/base/common_scripts.html
@@ -47,7 +47,7 @@ IF c.user_exists AND (c.user.from_body OR c.user.is_superuser);
END;
IF bodyclass.match('mappage');
- FOR script IN map_js.merge(c.cobrand.call_hook('map_js_extra', c));
+ FOR script IN map_js.merge(c.cobrand.call_hook('map_js_extra'));
IF script.match('^/');
scripts.push(version(script));
ELSE;
diff --git a/web/cobrands/fixmystreet/admin.js b/web/cobrands/fixmystreet/admin.js
index 3066ee614..c40a7f960 100644
--- a/web/cobrands/fixmystreet/admin.js
+++ b/web/cobrands/fixmystreet/admin.js
@@ -165,7 +165,7 @@ $(function(){
function renumber_metadata_fields($item) {
var item_index = $item.data("index");
- $item.find("input[data-field-name").each(function(i) {
+ $item.find("[data-field-name]").each(function(i) {
var $input = $(this);
var prefix = "metadata["+item_index+"].";
var name = prefix + $input.data("fieldName");