Francois Gouget : testbot/cgi: Move saving items to ItemPage::Save().
Alexandre Julliard
julliard at winehq.org
Wed Mar 9 15:43:01 CST 2022
Module: tools
Branch: master
Commit: 5f75332e5039dc2784a539c0c718e76df997bd74
URL: https://source.winehq.org/git/tools.git/?a=commit;h=5f75332e5039dc2784a539c0c718e76df997bd74
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Wed Mar 9 20:13:53 2022 +0100
testbot/cgi: Move saving items to ItemPage::Save().
A FormPage has no Collection field and no concept of what an Item
object is so it should not be trying to save items.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/lib/ObjectModel/CGI/FormPage.pm | 5 +----
testbot/lib/ObjectModel/CGI/ItemPage.pm | 10 ++++++++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm
index 9ea7f0f..3ac6223 100644
--- a/testbot/lib/ObjectModel/CGI/FormPage.pm
+++ b/testbot/lib/ObjectModel/CGI/FormPage.pm
@@ -388,10 +388,7 @@ sub Save($)
{
my ($self) = @_;
- return !1 if (!$self->SaveProperties());
-
- (my $_ErrKey, $self->{ErrField}, $self->{ErrMessage}) = $self->{Collection}->Save();
- return ! defined($self->{ErrMessage});
+ return $self->SaveProperties();
}
sub OnAction($$)
diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm
index 9b9f2ff..6d94491 100644
--- a/testbot/lib/ObjectModel/CGI/ItemPage.pm
+++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm
@@ -134,6 +134,16 @@ sub SaveProperty($$$)
return 1;
}
+sub Save($)
+{
+ my ($self) = @_;
+
+ return !1 if (!$self->SUPER::Save());
+
+ (my $_ErrKey, $self->{ErrField}, $self->{ErrMessage}) = $self->{Collection}->Save();
+ return !defined $self->{ErrMessage};
+}
+
sub OnAction($$)
{
my ($self, $Action) = @_;
More information about the wine-cvs
mailing list