aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--t/app/controller/report_new_open311.t3
-rw-r--r--templates/web/base/report/new/category_extras_fields.html2
3 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7461fbf85..f3b2e82a5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,7 @@
- Prevent duplicate contact history creation with Unicode data.
- Show all Open311 extra fields in edit admin.
- Proper bodies check for sending updates.
+ - Check better if extra question has values.
- Development improvements:
- Make front page cache time configurable.
- Better working of /fakemapit/ under https.
diff --git a/t/app/controller/report_new_open311.t b/t/app/controller/report_new_open311.t
index 22b4409b5..dc9a26791 100644
--- a/t/app/controller/report_new_open311.t
+++ b/t/app/controller/report_new_open311.t
@@ -267,7 +267,7 @@ subtest "Category extras includes description label for user" => sub {
ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
MAPIT_URL => 'http://mapit.uk/',
}, sub {
- $contact4->push_extra_fields({ description => 'Size?', code => 'size', required => 'true', automated => '', variable => 'true', order => '3' });
+ $contact4->push_extra_fields({ description => 'Size?', code => 'size', required => 'true', automated => '', variable => 'true', order => '3', values => undef });
$contact4->update;
for (
{ url => '/report/new/ajax?' },
@@ -280,6 +280,7 @@ subtest "Category extras includes description label for user" => sub {
lacks_string($category_extra, "USRN", "Lacks 'USRN' label");
lacks_string($category_extra, "Asset ID", "Lacks 'Asset ID' label");
contains_string($category_extra, "Size?");
+ lacks_string($category_extra, '<option value=""');
contains_string($category_extra, "resolve your problem quicker, by providing some extra detail", "Contains description text");
}
};
diff --git a/templates/web/base/report/new/category_extras_fields.html b/templates/web/base/report/new/category_extras_fields.html
index df6129672..dd5c3911d 100644
--- a/templates/web/base/report/new/category_extras_fields.html
+++ b/templates/web/base/report/new/category_extras_fields.html
@@ -14,7 +14,7 @@
<p class='form-error'>[% field_errors.$x_meta_name %]</p>
[% END -%]
[% IF meta.variable != 'false' %]
- [% IF meta.exists('values') %]
+ [% IF meta.item('values').size %]
<select class="form-control" name="[% cat_prefix %][% meta_name %]" id="[% cat_prefix %]form_[% meta_name %]"[% meta.required == 'true' ? ' required' : '' %]>
<option value="">[% loc('-- Pick an option --') %]</option>
[% FOR option IN meta.values %]