summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;