From 0b5e63fd4478ca93114cdaabe0b267883b5f54eb Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 8 Jan 2015 16:56:25 +0000 Subject: Bug 1119114: bzapi/configuration returns empty flag_types if no bug or attachment flag types are defined --- extensions/BzAPI/template/en/default/config.json.tmpl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'extensions/BzAPI') diff --git a/extensions/BzAPI/template/en/default/config.json.tmpl b/extensions/BzAPI/template/en/default/config.json.tmpl index 993b34915..340a8e650 100644 --- a/extensions/BzAPI/template/en/default/config.json.tmpl +++ b/extensions/BzAPI/template/en/default/config.json.tmpl @@ -141,14 +141,11 @@ OLDATTACH2NEW = { "id": [% component.id FILTER json %], [% IF show_flags %] "flag_type": [ - [% flag_types = - component.flag_types(is_active=>1).bug.merge(component.flag_types(is_active=>1).attachment) %] - [%-# "first" flag used to get commas right; can't use loop.last() in case - # last flag is inactive %] - [% first = 1 %] + [% flag_types = component.flag_types(is_active=>1).bug || [] %] + [% flag_types = flag_types.merge(component.flag_types(is_active=>1).attachment || []) %] [% FOREACH flag_type = flag_types %] [% all_visible_flag_types.${flag_type.id} = flag_type %] - [% ',' UNLESS first %][% flag_type.id FILTER json %][% first = 0 %] + [%- ',' UNLESS loop.first %][% flag_type.id FILTER json %] [% END %]], [% END %] "description": "[% component.description FILTER json %]" -- cgit v1.2.3-24-g4f1b