Module: tools
Branch: master
Commit: 7c4057fc01efff68681b9c82035f340b3140d6c9
URL: https://source.winehq.org/git/tools.git/?a=commit;h=7c4057fc01efff68681b9c8…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Fri Mar 25 11:21:56 2022 +0100
testbot/web: Provide a property list for the special jobs page.
The property descriptors list can be empty, but it must not be left
undefined forever.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/admin/SpecialJobs.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/web/admin/SpecialJobs.pl b/testbot/web/admin/SpecialJobs.pl
index 02d9f8e..79160e4 100644
--- a/testbot/web/admin/SpecialJobs.pl
+++ b/testbot/web/admin/SpecialJobs.pl
@@ -90,7 +90,7 @@ sub _initialize($$$)
$JobTemplate->{VMKey} ||= "*No";
}
- $self->SUPER::_initialize($Request, $RequiredRole, undef);
+ $self->SUPER::_initialize($Request, $RequiredRole, []);
}
Module: tools
Branch: master
Commit: cb2e09e463c68af4bd2480bbba6749a0d48efba1
URL: https://source.winehq.org/git/tools.git/?a=commit;h=cb2e09e463c68af4bd2480b…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Fri Mar 25 11:17:12 2022 +0100
testbot/web: The Submit page should always provide a property list.
FormPage expects to be provided with a property list when it calls
GetPropertyDescriptors() at the very latest. So while that method may
return an empty list, returning undef is not allowed.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/web/Submit.pl | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 79d1c87..472622d 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -665,16 +665,23 @@ sub GetPropertyDescriptors($)
my ($self) = @_;
# Note that this may be called for different pages. For instance first to
- # validate the properties of the page 1, then again to generate the form
- # fields of page 2. See _SetPage().
- if ($self->{Page} == 1)
+ # validate the page 1 properties, then again to generate the page 2 form
+ # fields. See _SetPage().
+ if ($self->{PropertyDescriptors})
{
- $self->{PropertyDescriptors} ||= [
+ # The property descriptors list is already set for $self->{Page}
+ }
+ elsif ($self->{Page} == 1)
+ {
+ $self->{PropertyDescriptors} = [
CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, !1, "A", 128),
];
}
- elsif (($self->{Page} == 3 or $self->{Page} == 4) and
- !$self->{PropertyDescriptors})
+ elsif ($self->{Page} == 2)
+ {
+ $self->{PropertyDescriptors} = []; # no fields, only a collection block
+ }
+ elsif ($self->{Page} == 3 or $self->{Page} == 4)
{
if ($self->{Page} == 4)
{
@@ -960,9 +967,12 @@ sub _SetPage($$)
{
my ($self, $Page) = @_;
- $self->{Page} = $Page;
- # Changing the page also changes the fields of the HTML form
- delete $self->{PropertyDescriptors};
+ if ($self->{Page} != $Page)
+ {
+ $self->{Page} = $Page;
+ # Changing the page also changes the fields of the HTML form
+ $self->{PropertyDescriptors} = undef;
+ }
}
sub OnUnset($)