From b5b68236b0da93bc61bac6b9bc7ec96cec4482de Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 29 Jun 2010 13:50:16 +0200 Subject: [PATCH] use $value and $count for facet eval --- lib/MojoFacets/Data.pm | 4 ++-- public/code/Botanical references.botanical_references.pl | 7 ++++--- templates/data/facet.html.ep | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 6eb3a6e..0f894bd 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -953,8 +953,8 @@ sub facet { if ( my $code = $self->param('code') ) { my $out; - foreach my $v ( keys %$facet ) { - my $c = $facet->{$v}; + foreach my $value ( keys %$facet ) { + my $count = $facet->{$value}; eval $code; if ( $@ ) { $out = $@; diff --git a/public/code/Botanical references.botanical_references.pl b/public/code/Botanical references.botanical_references.pl index 249314f..4fc2113 100644 --- a/public/code/Botanical references.botanical_references.pl +++ b/public/code/Botanical references.botanical_references.pl @@ -1,3 +1,4 @@ -foreach my $v ( @{ $row->{'Botanical references'} } ) { - $row->{botanical_references} = [ split(/\s*,\s*/,$v) ] -} \ No newline at end of file +foreach my $v ( @{ $row->{'Botanical references'} } ) { + $update->{botanical_references} = [ split(/\s*[,\.\s]\s*/,$v) ] +} + diff --git a/templates/data/facet.html.ep b/templates/data/facet.html.ep index 10cca77..689b4ad 100644 --- a/templates/data/facet.html.ep +++ b/templates/data/facet.html.ep @@ -60,8 +60,9 @@ First <%= $max_facets %> shown % }
-Eval code on each facet value and count: -$out->{sum} += $v * $c
+Eval code on each facet $value and $count +$out->{sum} += $value * $count +
-- 2.20.1