From 88deb0d3aeb9c476b3ac8a520a588fb0c00fa5ee Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 28 Oct 2024 17:00:24 -0400 Subject: [PATCH] Bug 1926574 - When changing product of a bug and the destination product only has one component, pre-select the one component --- extensions/BugModal/lib/WebService.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/BugModal/lib/WebService.pm b/extensions/BugModal/lib/WebService.pm index 1e8788aed2..b489bca3e6 100644 --- a/extensions/BugModal/lib/WebService.pm +++ b/extensions/BugModal/lib/WebService.pm @@ -311,6 +311,10 @@ sub new_product { # identical component in both products $component->{selected} = $true; } + elsif (scalar @{$components} == 1) { + # New product has one component so preselect it + $components->[0]->{selected} = $true; + } else { # default to a blank value unshift @$components, {name => '', selected => $true,};