aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2026-08-08 18:10:05 +0100
committerSam James <sam@gentoo.org>2026-08-08 18:10:05 +0100
commita3ce820a0ef78931b76b022db12a4ab5caf4841c (patch)
tree085943ad469a55c803cc0a73cd6b74d9a141fe5f
parentshow_activity.cgi, showdependencytree.cgi: import constants (diff)
parentBug 1962909: less-confusing verbiage about the expiration date in new account... (diff)
downloadbugzilla-master.tar.gz
bugzilla-master.tar.bz2
bugzilla-master.zip
Merge remote-tracking branch 'upstream/5.2' into bugstestHEADgentoo-5.2.0.19masterbugstest
-rw-r--r--Bugzilla/Bug.pm2
-rw-r--r--Bugzilla/DB/MariaDB.pm21
-rw-r--r--Bugzilla/DB/Mysql.pm21
-rw-r--r--Bugzilla/DB/Oracle.pm2
-rw-r--r--Bugzilla/Search.pm2
-rw-r--r--Bugzilla/Template/Plugin/Hook.pm2
-rw-r--r--README7
-rw-r--r--docker-compose.yml1
-rw-r--r--docker/checksetup_answers.txt2
-rwxr-xr-xdocker/startup.sh24
-rw-r--r--docs/en/rst/_static/bugzilla.css11
-rwxr-xr-xrequest.cgi4
-rw-r--r--template/en/default/account/email/request-new.txt.tmpl2
-rw-r--r--template/en/default/setup/strings.txt.pl7
-rw-r--r--xt/lib/Bugzilla/Test/Search/Constants.pm10
15 files changed, 95 insertions, 23 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 009ce643c..d0c4edce8 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -587,7 +587,7 @@ sub possible_duplicates {
my $products = $params->{products} || [];
my $limit = $params->{limit} || MAX_POSSIBLE_DUPLICATES;
$limit = MAX_POSSIBLE_DUPLICATES if $limit > MAX_POSSIBLE_DUPLICATES;
- $products = [$products] if !(ref($products) eq 'ARRAY');
+ $products = [$products] if ref($products) ne 'ARRAY';
my $orig_limit = $limit;
detaint_natural($limit)
diff --git a/Bugzilla/DB/MariaDB.pm b/Bugzilla/DB/MariaDB.pm
index 80ff5aae8..76b708854 100644
--- a/Bugzilla/DB/MariaDB.pm
+++ b/Bugzilla/DB/MariaDB.pm
@@ -728,14 +728,19 @@ sub bz_setup_database {
if (Bugzilla->params->{'utf8'} && $non_utf8_tables) {
print "\n", install_string('mysql_utf8_conversion');
- if (!Bugzilla->installation_answers->{NO_PAUSE}) {
- if (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
- die install_string('continue_without_answers'), "\n";
- }
- else {
- print "\n " . install_string('enter_or_ctrl_c');
- getc;
- }
+ my $allow_unsafe_utf8_conversion
+ = Bugzilla->installation_answers->{ALLOW_UNSAFE_UTF8_CONVERSION};
+ if ($allow_unsafe_utf8_conversion) {
+ print "\n"
+ . install_string('continuing_with_unsafe_utf8_conversion')
+ . "\n";
+ }
+ elsif (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
+ die install_string('continue_without_answers'), "\n";
+ }
+ else {
+ print "\n " . install_string('enter_or_ctrl_c');
+ getc;
}
print
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 826cd6272..d048faadf 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -728,14 +728,19 @@ sub bz_setup_database {
if (Bugzilla->params->{'utf8'} && $non_utf8_tables) {
print "\n", install_string('mysql_utf8_conversion');
- if (!Bugzilla->installation_answers->{NO_PAUSE}) {
- if (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
- die install_string('continue_without_answers'), "\n";
- }
- else {
- print "\n " . install_string('enter_or_ctrl_c');
- getc;
- }
+ my $allow_unsafe_utf8_conversion
+ = Bugzilla->installation_answers->{ALLOW_UNSAFE_UTF8_CONVERSION};
+ if ($allow_unsafe_utf8_conversion) {
+ print "\n"
+ . install_string('continuing_with_unsafe_utf8_conversion')
+ . "\n";
+ }
+ elsif (Bugzilla->installation_mode == INSTALLATION_MODE_NON_INTERACTIVE) {
+ die install_string('continue_without_answers'), "\n";
+ }
+ else {
+ print "\n " . install_string('enter_or_ctrl_c');
+ getc;
}
print
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 30015a0d7..13e8f0631 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -117,7 +117,7 @@ sub sql_group_concat {
my ($self, $text, $separator) = @_;
$separator = $self->quote(', ') if !defined $separator;
my ($distinct, $rest) = $text =~ /^(\s*DISTINCT\s|)(.+)$/i;
- return "group_concat($distinct T_CLOB_DELIM(NVL($rest, ' '), $separator))";
+ return "group_concat($distinct T_CLOB_DELIM(NVL(TO_CHAR($rest), ' '), $separator))";
}
sub sql_regexp {
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index efdc39f81..c38e8b071 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -2900,7 +2900,7 @@ sub _flagtypes_nonchanged {
# don't call build_subselect as this must run as a true sub-select
$args->{term} = "EXISTS (
SELECT 1
- FROM $bugs_table bugs_$chart_id
+ FROM bugs bugs_$chart_id
LEFT JOIN attachments AS attachments_$chart_id
ON bugs_$chart_id.bug_id = attachments_$chart_id.bug_id
LEFT JOIN flags AS flags_$chart_id
diff --git a/Bugzilla/Template/Plugin/Hook.pm b/Bugzilla/Template/Plugin/Hook.pm
index e315ab79e..f937a8f7c 100644
--- a/Bugzilla/Template/Plugin/Hook.pm
+++ b/Bugzilla/Template/Plugin/Hook.pm
@@ -33,7 +33,7 @@ sub process {
$template ||= $context->stash->{component}->{name};
# sanity check:
- if (!$template =~ /[\w\.\/\-_\\]+/) {
+ if ($template !~ /[\w\.\/\-_\\]+/) {
ThrowCodeError('template_invalid', {name => $template});
}
diff --git a/README b/README
index b867a994d..b231c3e8d 100644
--- a/README
+++ b/README
@@ -22,6 +22,13 @@ and type `docker compose up`. The URL to access and the username and password
for the default admin account will be shown on the console once it finishes
setting it up.
+If checksetup.pl stops in Docker because UTF-8 conversion requires an
+interactive confirmation, you can explicitly allow that conversion with:
+
+ BZ_ALLOW_UNSAFE_UTF8_CONVERSION=1 docker compose up
+
+Only do this if you understand the warning and have a backup of your data.
+
Reporting Bugs
==============
diff --git a/docker-compose.yml b/docker-compose.yml
index eb2e68543..ba45ac5ba 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -30,6 +30,7 @@ services:
- BZ_DB_USER=bugs
- BZ_DB_NAME=bugs
- BZ_DB_PASS=bugzilla
+ - BZ_ALLOW_UNSAFE_UTF8_CONVERSION=${BZ_ALLOW_UNSAFE_UTF8_CONVERSION:-0}
- MARIADB_ROOT_HOST=%
- MARIADB_ROOT_PASSWORD=bugzilla
diff --git a/docker/checksetup_answers.txt b/docker/checksetup_answers.txt
index 1a4282232..e013fcd13 100644
--- a/docker/checksetup_answers.txt
+++ b/docker/checksetup_answers.txt
@@ -2,6 +2,7 @@ $answer{'ADMIN_EMAIL'} = %%BZ_ADMIN_EMAIL%%;
$answer{'ADMIN_OK'} = 'Y';
$answer{'ADMIN_PASSWORD'} = %%BZ_ADMIN_PASSWORD%%;
$answer{'ADMIN_REALNAME'} = %%BZ_ADMIN_REALNAME%%;
+$answer{'NO_PAUSE'} = '1';
$answer{'webservergroup'} = 'www-data';
$answer{'use_suexec'} = '0';
$answer{'db_driver'} = 'mariadb';
@@ -37,3 +38,4 @@ $answer{'db_mysql_ssl_ca_file'} = '';
$answer{'db_mysql_ssl_ca_path'} = '';
$answer{'db_mysql_ssl_client_cert'} = '';
$answer{'db_mysql_ssl_client_key'} = '';
+$answer{'ALLOW_UNSAFE_UTF8_CONVERSION'} = %%BZ_ALLOW_UNSAFE_UTF8_CONVERSION%%;
diff --git a/docker/startup.sh b/docker/startup.sh
index 205613828..a973b53fd 100755
--- a/docker/startup.sh
+++ b/docker/startup.sh
@@ -43,8 +43,30 @@ s/%%BZ_DB_NAME%%/'$BZ_DB_NAME'/;
s/%%BZ_DB_USER%%/'$BZ_DB_USER'/;
s/%%BZ_DB_PASS%%/'${BZ_DB_PASS//@/\\@//$/\\$}'/;
s@%%BZ_URLBASE%%@'${BZ_URLBASE//@/\\@}'@;
+s/%%BZ_ALLOW_UNSAFE_UTF8_CONVERSION%%/${BZ_ALLOW_UNSAFE_UTF8_CONVERSION:-0}/;
" /root/docker/checksetup_answers.txt
-perl checksetup.pl /root/docker/checksetup_answers.txt
+
+CHECKSETUP_LOG=$(mktemp)
+perl checksetup.pl /root/docker/checksetup_answers.txt 2>&1 | tee "$CHECKSETUP_LOG"
+CHECKSETUP_EXIT=${PIPESTATUS[0]}
+
+if [ $CHECKSETUP_EXIT -ne 0 ]; then
+ if grep -q "Re-run checksetup.pl in interactive mode" "$CHECKSETUP_LOG"; then
+ cat - <<EOF
+
+checksetup.pl stopped because a potentially destructive conversion requires
+explicit approval in non-interactive mode.
+
+To proceed with the UTF-8 conversion in Docker, re-run with:
+ BZ_ALLOW_UNSAFE_UTF8_CONVERSION=1 docker compose up
+
+Only use this if you understand the warning and have a database backup.
+EOF
+ fi
+ exit $CHECKSETUP_EXIT
+fi
+
+rm -f "$CHECKSETUP_LOG"
echo "Checksetup completed."
LOGIN_USER="Admin user: $BZ_ADMIN_EMAIL"
diff --git a/docs/en/rst/_static/bugzilla.css b/docs/en/rst/_static/bugzilla.css
index 8d1132f24..5369bfd22 100644
--- a/docs/en/rst/_static/bugzilla.css
+++ b/docs/en/rst/_static/bugzilla.css
@@ -3,3 +3,14 @@
min-width: 150px;
width: 350px;
}
+
+.wy-table-responsive table td,
+.wy-table-responsive table th {
+ white-space: wrap;
+}
+
+.rst-content table.docutils td,
+.rst-content table.field-list td,
+.wy-table td {
+ vertical-align: top;
+}
diff --git a/request.cgi b/request.cgi
index aa647bef3..6b8a9be0c 100755
--- a/request.cgi
+++ b/request.cgi
@@ -55,13 +55,15 @@ if ($action eq 'queue') {
else {
my $flagtypes = get_flag_types();
my @types = ('all', @$flagtypes);
+ my $products = $user->get_selectable_products;
my $vars = {};
$vars->{'types'} = \@types;
$vars->{'requests'} = {};
+ $vars->{'products'} = $products;
my %components;
- foreach my $prod (@{$user->get_selectable_products}) {
+ foreach my $prod (@$products) {
foreach my $comp (@{$prod->components}) {
$components{$comp->name} = 1;
}
diff --git a/template/en/default/account/email/request-new.txt.tmpl b/template/en/default/account/email/request-new.txt.tmpl
index 8ca0ff122..2bdd614e6 100644
--- a/template/en/default/account/email/request-new.txt.tmpl
+++ b/template/en/default/account/email/request-new.txt.tmpl
@@ -25,7 +25,7 @@ following link by [% expiration_ts FILTER time("%B %e, %Y at %H:%M %Z") %]:
[%+ urlbase %]token.cgi?t=[% token FILTER uri %]&a=request_new_account
-If you did not receive this email before [% expiration_ts FILTER time("%B %e, %Y at %H:%M %Z") %] or
+If you did not visit the above link by [% expiration_ts FILTER time("%B %e, %Y at %H:%M %Z") %] or
you wish to create an account using a different email address you can begin
again by going to:
diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl
index 649e3d5f8..e6d311981 100644
--- a/template/en/default/setup/strings.txt.pl
+++ b/template/en/default/setup/strings.txt.pl
@@ -54,6 +54,13 @@ EOT
continue_without_answers => <<'END',
Re-run checksetup.pl in interactive mode (without an 'answers' file)
to continue.
+
+To continue non-interactively, set ALLOW_UNSAFE_UTF8_CONVERSION to 1
+in your answers file.
+END
+ continuing_with_unsafe_utf8_conversion => <<'END',
+WARNING: ALLOW_UNSAFE_UTF8_CONVERSION is enabled. Continuing the UTF-8
+ conversion without an interactive confirmation prompt.
END
cpan_bugzilla_home => "WARNING: Using the Bugzilla directory as the CPAN home.",
db_blocklisted => <<END,
diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm
index fe5b0a7b7..7760ba432 100644
--- a/xt/lib/Bugzilla/Test/Search/Constants.pm
+++ b/xt/lib/Bugzilla/Test/Search/Constants.pm
@@ -1244,6 +1244,16 @@ use constant CUSTOM_SEARCH_TESTS => (
]
},
+ {
+ name => 'flagtypes.name = <1> AND flagtypes.name = <1>',
+ contains => [1],
+ top_params => {j_top => 'AND_G'},
+ params => [
+ {f => 'flagtypes.name', o => 'equals', v => '<1>'},
+ {f => 'flagtypes.name', o => 'equals', v => '<1>'},
+ ]
+ },
+
);
1;