[tools 1/4] testbot/cgi: Don't pass the master columns to the details pages.
Francois Gouget
fgouget at codeweavers.com
Tue Jun 7 11:49:39 CDT 2022
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>
---
.../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 e8156a1bf..7d42ba2c2 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()})
--
2.30.2
More information about the wine-devel
mailing list