summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2005-09-13 20:12:04 +0000
committerivan <ivan>2005-09-13 20:12:04 +0000
commitc2f77e3e9f95934545331b62a19579e45c98d403 (patch)
tree8de1f5b53b05a060e3b708a04fc601e0c6b53bfe /httemplate/search
parent9e342300c380e29af1b9678f1a9604609e0061b6 (diff)
fix redirect with single item returned from search results and a coderef redirect
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/elements/search.html4
1 files changed, 3 insertions, 1 deletions
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;