@@ -25,6 +25,13 @@ use JSON::XS qw(encode_json);
25
25
26
26
our $VERSION = ' 1' ;
27
27
28
+ use constant READABLE_BUG_STATUS_PRODUCTS => (
29
+ ' Core' , ' Toolkit' ,
30
+ ' Firefox' , ' Firefox for Android' ,
31
+ ' Firefox for iOS' , ' Bugzilla' ,
32
+ ' bugzilla.mozilla.org'
33
+ );
34
+
28
35
sub show_bug_format {
29
36
my ($self , $args ) = @_ ;
30
37
$args -> {format } = _alternative_show_bug_format();
@@ -194,24 +201,24 @@ sub template_before_process {
194
201
file => ' bug/edit.html.tmpl' , vars => $vars ,
195
202
});
196
203
197
- # bugzilla-readable-status
198
- my @flags = map { {name => $_ -> name, status => $_ -> status} } @{$bug -> flags};
199
- $vars -> {readable_bug_status_json } = encode_json({
200
- dupe_of => $bug -> dup_id,
201
- id => $bug -> id,
202
- keywords => [map { $_ -> name } @{$bug -> keyword_objects}],
203
- priority => $bug -> priority,
204
- resolution => $bug -> resolution,
205
- status => $bug -> bug_status,
206
- flags => \@flags ,
207
- target_milestone => $bug -> target_milestone,
208
- Bugzilla -> has_extension( ' TrackingFlags ' )
209
- ? map { $_ -> name => $_ -> bug_flag( $bug -> id) -> value } @{ $vars -> { tracking_flags }}
210
- : {},
211
- });
212
- # HTML4 attributes cannot be longer than this, so just skip it in this case.
213
- if ( length ( $vars -> {readable_bug_status_json }) > 65536) {
214
- delete $vars -> { readable_bug_status_json };
204
+ if (any { $bug -> product eq $_ } READABLE_BUG_STATUS_PRODUCTS) {
205
+ my @flags = map { {name => $_ -> name, status => $_ -> status} } @{$bug -> flags};
206
+ $vars -> {readable_bug_status_json } = encode_json({
207
+ dupe_of => $bug -> dup_id,
208
+ id => $bug -> id,
209
+ keywords => [map { $_ -> name } @{$bug -> keyword_objects}],
210
+ priority => $bug -> priority,
211
+ resolution => $bug -> resolution,
212
+ status => $bug -> bug_status,
213
+ flags => \@flags ,
214
+ target_milestone => $bug -> target_milestone,
215
+ map { $_ -> name => $_ -> bug_flag( $bug -> id) -> value } @{ $vars -> { tracking_flags }},
216
+ });
217
+
218
+ # HTML4 attributes cannot be longer than this, so just skip it in this case.
219
+ if ( length ( $vars -> { readable_bug_status_json }) > 65536) {
220
+ delete $vars -> {readable_bug_status_json };
221
+ }
215
222
}
216
223
217
224
# bug->choices loads a lot of data that we want to lazy-load
0 commit comments