[html-formfu] Bug?
Carl Franks
fireartist at gmail.com
Fri Jun 25 13:17:19 GMT 2010
On 25 June 2010 13:15, Octavian Rasnita <orasnita at gmail.com> wrote:
> Thanks for telling me about that script. I didn't know about it.
>
> I have tested a config file that has a single <constraints>...</constraints>
> and the results printed was a hashref like:
>
> constraints => {
> type => 'Required',
> },
>
> but if I added 2 constraints, the result was an arrayref:
>
> constraints => [
> {
> type => 'Required',
> },
> {
> type => 'Word',
> },
> ],
>
> So I don't know what it should be, a hashref, or an arrayref that contains
> more hashrefs.
>
> Or maybe it works with both of them, but I don't know then why it gives that
> error when it is not a hashref.
I've updated the _merge_hashes() method so it can also merge arrays
and hashes into a new array.
For example, this:
---
default_args:
elements:
DateTime:
constraints:
- type: DateTime
parser:
strptime: '%Y-%m-%d %H:%M:00'
elements:
- type: DateTime
name: foo
constraints:
type: Required
Will now be munged into this, before being passed to populate()
---
elements:
- type: DateTime
name: foo
constraints:
- type: DateTime
parser:
strptime: '%Y-%m-%d %H:%M:00'
- type: Required
This is fixed in svn -r1724
Cheers,
Carl
More information about the HTML-FormFu
mailing list