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;


_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to