Francois Gouget : testbot/cgi: Don't pass the master columns to the details pages.

Alexandre Julliard julliard at winehq.org
Tue Jun 7 15:37:01 CDT 2022


Module: tools
Branch: master
Commit: 5156da1e4b7bc8fa34f85784ddf7084b28f6284b
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=5156da1e4b7bc8fa34f85784ddf7084b28f6284b

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Jun  7 18:49:39 2022 +0200

testbot/cgi: Don't pass the master columns to the details pages.

The details pages have no way to pass the master columns to the
collection used to retrieve the Item to display: what they would need
instead is a master object. So they don't even try to retrieve the
master column values from the parameters (see *Param() in the FormPage
and ItemPage classes).
Fortunately so far there is no case where we need this functionality.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/lib/ObjectModel/CGI/CollectionBlock.pm | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
index e8156a1..7d42ba2 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
@@ -240,15 +240,6 @@ sub GetDetailsLink($$)
   if (!$Row->{DetailsLink})
   {
     $Row->{DetailsLink} = "$Row->{DetailsPage}?Key=". uri_escape($Row->{Item}->GetKey());
-    my ($MasterColNames, $MasterColValues) = $Row->{Item}->GetMasterCols();
-    if (defined $MasterColNames)
-    {
-      foreach my $ColIndex (0..$#{$MasterColNames})
-      {
-        $Row->{DetailsLink} .= "&". $MasterColNames->[$ColIndex] ."=".
-                               uri_escape($MasterColValues->[$ColIndex]);
-      }
-    }
   }
   return $Row->{DetailsLink};
 }
@@ -680,17 +671,7 @@ sub OnAction($$)
 
   if ($self->{RW} and $Action eq $self->GetAddButtonLabel())
   {
-    my $Target = $self->GetDetailsPage();
-    my ($MasterColNames, $MasterColValues) = $self->{Collection}->GetMasterCols();
-    if (defined($MasterColNames))
-    {
-      foreach my $ColIndex (0..$#{$MasterColNames})
-      {
-        $Target .= ($ColIndex == 0 ? "?" : "&") . $MasterColNames->[$ColIndex] .
-                   "=" . uri_escape($MasterColValues->[$ColIndex]);
-      }
-    }
-    exit($self->{EnclosingPage}->Redirect($Target));
+    exit($self->{EnclosingPage}->Redirect($self->GetDetailsPage()));
   }
 
   foreach my $Key (@{$self->{Collection}->GetKeys()})




More information about the wine-cvs mailing list