[html-formfu] Yet another problem with CompoundJoin
Moritz Onken
onken at houseofdesign.de
Thu Aug 21 16:57:09 BST 2008
Hi,
I have this piece of a config file:
- type: Multi
name: until
deflators:
- type: Strftime
strftime: %d.%m.%Y %R
inflators:
- type: DateTime
parser:
strptime: %d.%m.%Y %H:%M
elements:
- type: Text
name: date
- type: Text
name: time
filter:
- type: CompoundJoin
Which works fine. But if I leave date and time empty the parser fails
because CompoundJoin joins these two fields with a space and that is
not parseable. Attached is a patch. The disadvantage is that if you
define a custom join character this character isn't recognized.
cheers,
moritz
--- /Users/mo/Documents/workspace/HTML-FormFu/lib/HTML/FormFu/Filter/
CompoundJoin.pm.bak
+++ CompoundJoin.pm
@@ -14,7 +14,7 @@
$join = ' ' if !defined $join;
my @values = $self->_get_values($value);
-
+ @values = grep {$_ ne ''} @values;
$value = join $join, @values;
return $value;
More information about the HTML-FormFu
mailing list