Francois Gouget : testbot/web: Remove a dependency on FormPage::SaveProperties() in VMDetails.
Alexandre Julliard
julliard at winehq.org
Tue Mar 22 16:37:57 CDT 2022
Module: tools
Branch: master
Commit: a35edaa2ee5e2e1813eabd634f3647b8d7f498ea
URL: https://source.winehq.org/git/tools.git/?a=commit;h=a35edaa2ee5e2e1813eabd634f3647b8d7f498ea
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Tue Mar 22 13:21:43 2022 +0100
testbot/web: Remove a dependency on FormPage::SaveProperties() in VMDetails.
Save() is already calling SaveProperties() to store the form fields in
the $VM object. Just make sure to check the old value of $VM->Errors
before it is ovewritten.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/web/admin/VMDetails.pl | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/testbot/web/admin/VMDetails.pl b/testbot/web/admin/VMDetails.pl
index 19983c6..f39b0d6 100644
--- a/testbot/web/admin/VMDetails.pl
+++ b/testbot/web/admin/VMDetails.pl
@@ -48,23 +48,21 @@ sub Save($)
{
my ($self) = @_;
- my $OldStatus = $self->{Item}->Status || "";
- return !1 if (!$self->SaveProperties());
-
- if ($OldStatus ne $self->{Item}->Status)
+ my $ResetErrors;
+ if (($self->GetParam("Status") || "") ne $self->{Item}->Status)
{
# The administrator action resets the consecutive error count
$self->{Item}->Errors(undef);
- my ($ErrProperty, $ErrMessage) = $self->{Item}->Validate();
- if (!defined $ErrMessage)
- {
- $self->{Item}->RecordStatus(undef, $self->{Item}->Status ." administrator");
- }
+ $ResetErrors = 1;
}
- my $ErrKey;
- ($ErrKey, $self->{ErrField}, $self->{ErrMessage}) = $self->{Collection}->Save();
- return ! defined($self->{ErrMessage});
+ return undef if (!$self->SUPER::Save());
+
+ if ($ResetErrors)
+ {
+ $self->{Item}->RecordStatus(undef, $self->{Item}->Status ." administrator");
+ }
+ return 1;
}
sub GenerateFooter($)
More information about the wine-cvs
mailing list