From c2f77e3e9f95934545331b62a19579e45c98d403 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 13 Sep 2005 20:12:04 +0000 Subject: fix redirect with single item returned from search results and a coderef redirect --- httemplate/search/elements/search.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'httemplate/search') diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 0f499d2d0..7882bbf56 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -183,7 +183,9 @@ } else { # regular HTML if ( exists($opt{'redirect'}) && scalar(@$rows) == 1 && $total == 1 ) { - my( $url, $method ) = @{$opt{'redirect'}}; + my $redirect = $opt{'redirect'}; + $redirect = &{$redirect}($rows->[0]) if ref($redirect) eq 'CODE'; + my( $url, $method ) = @$redirect; redirect( $url. $rows->[0]->$method() ); } else { ( my $xlsname = $opt{'name'} ) =~ s/\W//g; -- cgit v1.2.1