summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-08-03 07:40:22 +0200
committerByron Jones <glob@mozilla.com>2015-08-03 07:40:22 +0200
commit0565d657ea0021c160f9ec0806455e9ea7465dc9 (patch)
treeaec57c29479478ccd4cafd39acd90e9a3e12ea09 /extensions/BugModal
parentd7208303b8e0d025490f338241b2abb24dc5f1f4 (diff)
downloadbugzilla-0565d657ea0021c160f9ec0806455e9ea7465dc9.tar.gz
bugzilla-0565d657ea0021c160f9ec0806455e9ea7465dc9.tar.xz
Bug 1190255 - modal UI is used immediately after bug creation, even if preferenced off
Diffstat (limited to 'extensions/BugModal')
-rw-r--r--extensions/BugModal/Extension.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/extensions/BugModal/Extension.pm b/extensions/BugModal/Extension.pm
index 4926f7414..da582bae8 100644
--- a/extensions/BugModal/Extension.pm
+++ b/extensions/BugModal/Extension.pm
@@ -46,12 +46,12 @@ sub _alternative_show_bug_format {
my $cgi = Bugzilla->cgi;
my $user = Bugzilla->user;
if (my $ctype = $cgi->param('ctype')) {
- return undef if $ctype ne 'html';
+ return '' if $ctype ne 'html';
}
if (my $format = $cgi->param('format')) {
- return ($format eq '__default__' || $format eq 'default') ? undef : $format;
+ return ($format eq '__default__' || $format eq 'default') ? '' : $format;
}
- return $user->setting('ui_experiments') eq 'on' ? 'modal' : undef;
+ return $user->setting('ui_experiments') eq 'on' ? 'modal' : '';
}
sub template_after_create {
@@ -157,7 +157,7 @@ sub template_before_process {
|| $file eq 'attachment/created.html.tmpl'
|| $file eq 'attachment/updated.html.tmpl')
{
- if (_alternative_show_bug_format()) {
+ if (_alternative_show_bug_format() eq 'modal') {
$vars->{alt_ui_header} = 'bug_modal/header.html.tmpl';
$vars->{alt_ui_show} = 'bug/show-modal.html.tmpl';
$vars->{alt_ui_edit} = 'bug_modal/edit.html.tmpl';
@@ -167,8 +167,7 @@ sub template_before_process {
return unless $file =~ m#^bug/show-([^\.]+)\.html\.tmpl$#;
my $format = $1;
- my $alt = _alternative_show_bug_format() // return;
- return unless $alt eq $format;
+ return unless _alternative_show_bug_format() eq $format;
return unless
$vars->{bugs}