return '' if $ctype ne 'html';
}
if (my $format = $cgi->param('format')) {
- return ($format eq '__default__' || $format eq 'default') ? '' : $format;
+ my @ids = $cgi->param('id');
+ # Drop `format=default` as well as `format=multiple`, if a single bug ID is
+ # provided, by redirecting to the modal UI (301 Moved Permanently)
+ if ($format eq '__default__' || $format eq 'default'
+ || ($format eq 'multiple' && scalar(@ids) == 1))
+ {
+ $cgi->base_redirect('show_bug.cgi?id=' . $cgi->param('id'), 1);
+ }
+ # Otherwise, printable `format=multiple` is still available from bug lists
+ # as the Long Format option
+ return $format;
}
return $user->setting('ui_experiments') eq 'on' ? 'modal' : '';
}
<button type="button" id="format-btn" aria-haspopup="true" aria-label="Format [% terms.Bug %] Menu"
aria-expanded="false" aria-controls="format-menu" class="dropdown-button minor">Format [% terms.Bug %] ▴</button>
<ul class="dropdown-content left menu-up" id="format-menu" role="menu" style="display:none;">
- <li role="presentation">
- <a href="[% basepath FILTER none %]show_bug.cgi?format=multiple&id=[% bug.id FILTER uri %]" role="menuitem" tabindex="-1">For Printing</a>
- </li>
<li role="presentation">
<a href="[% basepath FILTER none %]show_bug.cgi?ctype=xml&id=[% bug.id FILTER uri %]" role="menuitem" tabindex="-1">XML</a>
</li>
- <li role="presentation">
- <a href="[% basepath FILTER none %]show_bug.cgi?format=default&id=[% bug.id FILTER uri %]" role="menuitem" tabindex="-1">Legacy</a>
- </li>
[% IF bug.groups_in.size == 0 %]
<li role="presentation">
<a href="[% basepath FILTER none %]rest/bug/[% bug.id FILTER uri %]" role="menuitem" tabindex="-1">JSON</a>
"You are not permitted to edit bugs in product TestProduct.");
logout($sel);
-# Test searches and "format for printing".
+# Test searches.
log_in($sel, $config, 'admin');
open_advanced_search_page($sel);
q{http://HOSTNAME:8000/buglist.cgi?cmdtype=runnamed&namedcmd=My%20bugs%20from%20QA_Selenium&list_id=17}
);
$sel->title_is("Bug List: My bugs from QA_Selenium");
-$sel->click_ok("long_format");
-check_page_load($sel, WAIT_TIME, q{http://HOSTNAME:8000/show_bug.cgi});
-$sel->title_is("Full Text Bug Listing");
-$sel->is_text_present_ok("Bug $bug1_id");
-$sel->is_text_present_ok("Status: CONFIRMED");
-$sel->is_text_present_ok(
- "Reporter: QA-Selenium-TEST <$config->{QA_Selenium_TEST_user_login}>");
-$sel->is_text_present_ok("Assignee: QA Admin <$config->{admin_user_login}>");
-$sel->is_text_present_ok("Severity: blocker");
-$sel->is_text_present_ok("Priority: Highest");
-$sel->is_text_present_ok("I have no privs, I can only comment");
logout($sel);
# Let's create a 2nd bug by this user so that we can test mass-change
$sel->select_ok("bug_status", "IN_QA");
edit_bug_and_return($sel, $bug1_id, $bug_summary);
-$sel->click_ok("link=Format For Printing");
-$sel->wait_for_page_to_load_ok(WAIT_TIME);
-$sel->title_is("Full Text Bug Listing");
-$sel->is_text_present_ok("Freetext$bug1_id: dumbo");
-$sel->is_text_present_ok("List$bug1_id: storage");
-$sel->is_text_present_ok("Status: IN_QA UPSTREAM");
go_to_bug($sel, $bug2_id);
$sel->select_ok("cf_qa_list_$bug1_id", "label=storage");
edit_bug($sel, $bug2_id);
+++ /dev/null
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-use strict;
-use warnings;
-use lib qw(lib ../../lib ../../local/lib/perl5);
-use Test::More "no_plan";
-use QA::Util;
-
-my ($sel, $config) = get_selenium();
-
-$sel->open_ok("/long_list.cgi?id=1");
-$sel->title_is("Full Text Bug Listing", "Display bug as format for printing");
-my $text = $sel->get_text('//*[@id="bugzilla-body"]//h1');
-$text =~ s/[\r\n\t\s]+/ /g;
-is($text, 'Bug 1', 'Display bug 1 specifically');
[% PROCESS global/variables.none.tmpl %]
[% IF bottom_navigator == 1 %]
<ul class="related_actions">
- <li><a href="[% basepath FILTER none %]show_bug.cgi?format=multiple&id=
- [% bug.bug_id FILTER uri %]">Format For Printing</a></li>
- <li> - <a href="[% basepath FILTER none %]show_bug.cgi?ctype=xml&id=
- [% bug.bug_id FILTER uri %]">XML</a></li>
+ <li><a href="[% basepath FILTER none %]show_bug.cgi?ctype=xml&id=[% bug.bug_id FILTER uri %]">XML</a></li>
[% IF NOT bug.groups_in.size %]
<li> - <a href="[% basepath FILTER none %]rest/bug/[% bug.bug_id FILTER uri %]">JSON</a></li>
[% END %]
<link rel="Show" title="[% terms.Bug %] Activity"
href="[% basepath FILTER none %]show_activity.cgi?id=[% bug.bug_id %]">
- <link rel="Show" title="Printer-Friendly Version"
- href="[% basepath FILTER none %]show_bug.cgi?format=multiple&id=[% bug.bug_id %]">
[% END %]