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@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()})
The details page's collection does not have master columns and thus it needs the full key to load the Item.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/ObjectModel/CGI/CollectionBlock.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm index 7d42ba2c2..0f0a3bd6b 100644 --- a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm +++ b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm @@ -239,7 +239,7 @@ sub GetDetailsLink($$)
if (!$Row->{DetailsLink}) { - $Row->{DetailsLink} = "$Row->{DetailsPage}?Key=". uri_escape($Row->{Item}->GetKey()); + $Row->{DetailsLink} = "$Row->{DetailsPage}?Key=". uri_escape($Row->{Item}->GetFullKey()); } return $Row->{DetailsLink}; }
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/lib/ObjectModel/CGI/ItemPage.pm | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm index 8bea816b0..b4d79e736 100644 --- a/testbot/lib/ObjectModel/CGI/ItemPage.pm +++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm @@ -106,16 +106,6 @@ sub GenerateFormStart($)
$self->SUPER::GenerateFormStart();
- my ($MasterColNames, $MasterColValues) = $self->{Collection}->GetMasterCols(); - if (defined($MasterColNames)) - { - foreach my $ColIndex (0..$#{$MasterColNames}) - { - print "<div><input type='hidden' name='", $MasterColNames->[$ColIndex], - "' value='", $self->escapeHTML($MasterColValues->[$ColIndex]), - "' /></div>\n"; - } - } if (! $self->{Item}->GetIsNew()) { print "<div><input type='hidden' name='Key' value='",
ItemPage ignores any master column parameter that it might receive so RedirectToList() has nothing to pass on. CollectionPage would ignore the master column parameters anyway. Fortunately this functionality is not used and not needed.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- This would only be needed if 2+-level hierarchies were represented with all the corresponding intermediate *List pages. For instance in the Job->Step case this would be JobsList -> JobDetails -> StepsList -> StepDetails. But that would be very cumbersome so of course the TestBot opted to eliminate the intermediate 'step' pages entirely so that there is only JobsList and JobDetails. This is why we don't currently even make use of this mechanism since all other details pages have no master column and link back to the global list page (i.e. UserDetails links back to the full users list, not a subset thereof, etc.). --- testbot/lib/ObjectModel/CGI/ItemPage.pm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/ItemPage.pm b/testbot/lib/ObjectModel/CGI/ItemPage.pm index b4d79e736..690458e3a 100644 --- a/testbot/lib/ObjectModel/CGI/ItemPage.pm +++ b/testbot/lib/ObjectModel/CGI/ItemPage.pm @@ -129,17 +129,7 @@ sub RedirectToList($) { my ($self) = @_;
- my $Target = $self->{Collection}->GetCollectionName() . "List.pl"; - my ($MasterColNames, $MasterColValues) = $self->{Collection}->GetMasterCols(); - if (defined($MasterColNames)) - { - foreach my $ColIndex (0..$#{$MasterColNames}) - { - $Target .= ($ColIndex == 0 ? "?" : "&") . $MasterColNames->[$ColIndex] . - "=" . url_escape($MasterColValues->[$ColIndex]); - } - } - return $self->Redirect($Target); + return $self->Redirect($self->{Collection}->GetCollectionName() . "List.pl"); }
sub OnAction($$)