Module: tools
Branch: master
Commit: 2a350500f2075a7da7c0b8337772ede3b94978d6
URL: http://source.winehq.org/git/tools.git/?a=commit;h=2a350500f2075a7da7c0b833…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Thu Jun 12 10:14:41 2014 +0200
testbot/lib: DBIBackend::LoadItem() must not return objects from the Collection scope.
Such checks belong to the higher levels. Doing them in LoadItem()
interferes with Collection::Validate(), causing it to think new items
are already present in the database whenever they don't have Sequence
keys.
---
testbot/lib/ObjectModel/DBIBackEnd.pm | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/testbot/lib/ObjectModel/DBIBackEnd.pm b/testbot/lib/ObjectModel/DBIBackEnd.pm
index c89fa64..06b139d 100644
--- a/testbot/lib/ObjectModel/DBIBackEnd.pm
+++ b/testbot/lib/ObjectModel/DBIBackEnd.pm
@@ -253,14 +253,24 @@ sub LoadCollection
$Statement->finish();
}
+=pod
+=over 12
+
+=item C<LoadItem()>
+
+Loads the specified Item from the database and adds it to the Collection.
+By design this method will not check if the Item is already present in the
+Collection scope. Such checks belong in the higher levels. This method will
+however put the Item in the Collection's scope.
+
+=back
+=cut
+
sub LoadItem
{
my $self = shift;
my ($Collection, $RequestedKey) = @_;
- my $Item = $Collection->GetScopeItem($RequestedKey);
- return $Item if (defined $Item);
-
my $Fields = $self->BuildFieldList($Collection->GetPropertyDescriptors());
my $Where = "";
@@ -283,7 +293,7 @@ sub LoadItem
my $Statement = $self->GetDb()->prepare($Query);
$Statement->execute(@Data);
- $Item = undef;
+ my $Item;
if (my $Row = $Statement->fetchrow_hashref())
{
$Item = $Collection->CreateItem();
Module: tools
Branch: master
Commit: 70ebd159c77017701d59d92f391a502e80bea2d3
URL: http://source.winehq.org/git/tools.git/?a=commit;h=70ebd159c77017701d59d92f…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Jun 9 12:43:28 2014 +0200
testbot/web: Use the default Domain and Path of our cookies.
The Path defaults to '/' which is what we want. The Domain is set to
the most restrictive value which is good. This also means we're no
longer putting the port number in the Domain value which fixes our
cookies when the web server is running on a non-standard port or the
connection is going through port forwarding.
---
testbot/lib/WineTestBot/CGI/PageBase.pm | 4 ----
1 file changed, 4 deletions(-)
diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm
index bfa44c4..a724507 100644
--- a/testbot/lib/WineTestBot/CGI/PageBase.pm
+++ b/testbot/lib/WineTestBot/CGI/PageBase.pm
@@ -162,8 +162,6 @@ sub SetCookies($)
$Cookie = CGI::Cookie->new(-Name => "SessionId",
-Value => $Session->Id,
-Expires => $Expire,
- -Domain => $ENV{"HTTP_HOST"},
- -Path => "/",
-Secure => $UseSSL);
$Request->err_headers_out->add("Set-Cookie", $Cookie);
}
@@ -184,8 +182,6 @@ sub SetCookies($)
$Cookie = CGI::Cookie->new(-Name => "SessionActive",
-Value => $SessionPermanent,
-Expires => $Expire,
- -Domain => $ENV{"HTTP_HOST"},
- -Path => "/",
-Secure => !1);
$Request->err_headers_out->add("Set-Cookie", $Cookie);
}