projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e34230
)
fix redirect with single item returned from search results and a coderef redirect
author
ivan
<ivan>
Tue, 13 Sep 2005 20:12:04 +0000
(20:12 +0000)
committer
ivan
<ivan>
Tue, 13 Sep 2005 20:12:04 +0000
(20:12 +0000)
httemplate/search/elements/search.html
patch
|
blob
|
history
diff --git
a/httemplate/search/elements/search.html
b/httemplate/search/elements/search.html
index
0f499d2
..
7882bbf
100644
(file)
--- 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;