r24464 - in /trunk/libhtml-formfu-perl: ./ debian/ debian/patches/ lib/HTML/ lib/HTML/FormFu/ lib/HTML/FormFu/Element/ lib/HTML/FormFu/Filter/ t/bugs/ t/elements/ t/elements/object/ t/form/ t/form/object/ t/nested/elements/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Fri Aug 22 13:56:06 UTC 2008
Author: ansgar-guest
Date: Fri Aug 22 13:56:02 2008
New Revision: 24464
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=24464
Log:
integrate new upstream version
Added:
trunk/libhtml-formfu-perl/t/bugs/not_nested.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/bugs/not_nested.t
trunk/libhtml-formfu-perl/t/elements/object/
- copied from r24463, branches/upstream/libhtml-formfu-perl/current/t/elements/object/
trunk/libhtml-formfu-perl/t/elements/object.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/elements/object.t
trunk/libhtml-formfu-perl/t/form/object/
- copied from r24463, branches/upstream/libhtml-formfu-perl/current/t/form/object/
trunk/libhtml-formfu-perl/t/form/object.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/form/object.t
trunk/libhtml-formfu-perl/t/nested/elements/block_repeatable_multi_named.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/nested/elements/block_repeatable_multi_named.t
trunk/libhtml-formfu-perl/t/nested/elements/block_repeatable_multi_named.yml
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/nested/elements/block_repeatable_multi_named.yml
trunk/libhtml-formfu-perl/t/nested/elements/block_repeatable_multi_named_filter.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/nested/elements/block_repeatable_multi_named_filter.t
trunk/libhtml-formfu-perl/t/nested/elements/block_repeatable_multi_named_filter.yml
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/nested/elements/block_repeatable_multi_named_filter.yml
trunk/libhtml-formfu-perl/t/nested/elements/multi.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/nested/elements/multi.t
trunk/libhtml-formfu-perl/t/nested/elements/multi_named.t
- copied unchanged from r24463, branches/upstream/libhtml-formfu-perl/current/t/nested/elements/multi_named.t
Removed:
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Filter/CompoundDateTime.pm
Modified:
trunk/libhtml-formfu-perl/Changes
trunk/libhtml-formfu-perl/MANIFEST
trunk/libhtml-formfu-perl/META.yml
trunk/libhtml-formfu-perl/Makefile.PL
trunk/libhtml-formfu-perl/debian/changelog
trunk/libhtml-formfu-perl/debian/patches/whatis-entries.diff
trunk/libhtml-formfu-perl/lib/HTML/FormFu.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Attribute.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Block.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Date.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Hidden.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Multi.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Repeatable.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_DateSelect.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_Field.pm
trunk/libhtml-formfu-perl/lib/HTML/FormFu/ObjectUtil.pm
Modified: trunk/libhtml-formfu-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/Changes?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/Changes (original)
+++ trunk/libhtml-formfu-perl/Changes Fri Aug 22 13:56:02 2008
@@ -1,3 +1,16 @@
+0.03003 2008-08-21
+
+ - Form and elements inside template files now have access to original
+ object via self.object
+
+ - Having a named Multi block within a Block with nested_name set, now works.
+
+ - New Element method is_block() which is true for Block elements.
+
+ - Multi no longers sets is_field(0) - it's now true for both is_field() and is_block().
+
+ - prereqs - set minimum version of Exporter.pm that exports import()
+
0.03002 2008-08-11
- Deprecate element_defaults() method.
Modified: trunk/libhtml-formfu-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/MANIFEST?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/MANIFEST (original)
+++ trunk/libhtml-formfu-perl/MANIFEST Fri Aug 22 13:56:02 2008
@@ -156,7 +156,6 @@
lib/HTML/FormFu/Filter.pm
lib/HTML/FormFu/Filter/_Compound.pm
lib/HTML/FormFu/Filter/Callback.pm
-lib/HTML/FormFu/Filter/CompoundDateTime.pm
lib/HTML/FormFu/Filter/CompoundJoin.pm
lib/HTML/FormFu/Filter/CompoundSprintf.pm
lib/HTML/FormFu/Filter/CopyValue.pm
@@ -240,6 +239,7 @@
t/bugs/field_no_name.t
t/bugs/filter_run_once.t
t/bugs/name_regex_chars.t
+t/bugs/not_nested.t
t/bugs/populate_element_coderef.t
t/bugs/render_processed_value_retain_default.t
t/bugs/render_processed_value_retain_default.yml
@@ -352,6 +352,8 @@
t/elements/no_block_tag.yml
t/elements/no_container_tag.t
t/elements/no_container_tag.yml
+t/elements/object.t
+t/elements/object/input
t/elements/password.t
t/elements/password_render_value.t
t/elements/password_retain_default.t
@@ -476,6 +478,8 @@
t/form/javascript_src.t
t/form/model.t
t/form/multiple_same_named_fields.t
+t/form/object.t
+t/form/object/form
t/form/param.t
t/form/param_array.t
t/form/param_list.t
@@ -533,6 +537,10 @@
t/nested/constraints/required.t
t/nested/element_name.t
t/nested/element_name.yml
+t/nested/elements/block_repeatable_multi_named.t
+t/nested/elements/block_repeatable_multi_named.yml
+t/nested/elements/block_repeatable_multi_named_filter.t
+t/nested/elements/block_repeatable_multi_named_filter.yml
t/nested/elements/block_without_name.t
t/nested/elements/block_without_name.yml
t/nested/elements/checkbox_force_default.t
@@ -540,6 +548,8 @@
t/nested/elements/date.t
t/nested/elements/file_post.t
t/nested/elements/file_post.txt
+t/nested/elements/multi.t
+t/nested/elements/multi_named.t
t/nested/elements/radio.t
t/nested/elements/radio_force_default.t
t/nested/elements/radio_retain_default.t
Modified: trunk/libhtml-formfu-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/META.yml?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/META.yml (original)
+++ trunk/libhtml-formfu-perl/META.yml Fri Aug 22 13:56:02 2008
@@ -34,6 +34,7 @@
DateTime::Format::Strptime: 0
DateTime::Locale: 0
Email::Valid: 0
+ Exporter: 5.57
File::ShareDir: 0
HTML::Scrubber: 0
HTML::TokeParser::Simple: 3.14
@@ -49,4 +50,4 @@
perl: 5.8.1
resources:
license: http://dev.perl.org/licenses/
-version: 0.03002
+version: 0.03003
Modified: trunk/libhtml-formfu-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/Makefile.PL?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/Makefile.PL (original)
+++ trunk/libhtml-formfu-perl/Makefile.PL Fri Aug 22 13:56:02 2008
@@ -3,6 +3,11 @@
name 'HTML-FormFu';
perl_version '5.008001';
all_from 'lib/HTML/FormFu.pm';
+
+# this is the lowest version of Exporter I can identify that exports import()
+# it's bundled with perl 5.83
+# version 5.567 that ships with perl 5.82 is no good
+requires 'Exporter' => '5.57';
requires 'Class::Accessor::Chained::Fast';
requires 'Class::C3';
Modified: trunk/libhtml-formfu-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/debian/changelog?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/debian/changelog (original)
+++ trunk/libhtml-formfu-perl/debian/changelog Fri Aug 22 13:56:02 2008
@@ -1,4 +1,4 @@
-libhtml-formfu-perl (0.03002-1) UNRELEASED; urgency=low
+libhtml-formfu-perl (0.03003-1) UNRELEASED; urgency=low
TODO:
+ some files miss whatis entries in POD documentation
Modified: trunk/libhtml-formfu-perl/debian/patches/whatis-entries.diff
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/debian/patches/whatis-entries.diff?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/debian/patches/whatis-entries.diff (original)
+++ trunk/libhtml-formfu-perl/debian/patches/whatis-entries.diff Fri Aug 22 13:56:02 2008
@@ -132,7 +132,7 @@
--- libhtml-formfu-perl.orig/lib/HTML/FormFu/Element/_Field.pm
+++ libhtml-formfu-perl/lib/HTML/FormFu/Element/_Field.pm
-@@ -1028,7 +1028,7 @@
+@@ -1041,7 +1041,7 @@
=head1 NAME
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu.pm Fri Aug 22 13:56:02 2008
@@ -73,7 +73,7 @@
*plugins = \&plugin;
*add_plugins = \&add_plugin;
-our $VERSION = '0.03002';
+our $VERSION = '0.03003';
$VERSION = eval $VERSION;
Class::C3::initialize();
@@ -922,6 +922,8 @@
$render{form} = \%render;
weaken( $render{form} );
+ $render{object} = $self;
+
if ( $self->force_error_message
|| ( $self->has_errors && defined $self->form_error_message ) )
{
@@ -1516,7 +1518,7 @@
L<size|HTML::FormFu::Element/size> of C<10>, and make every C<Strftime>
deflator automatically get it's strftime set to C<%d/%m/%Y>:
- element_args:
+ default_args:
elements:
Text:
size: 10
@@ -1527,7 +1529,7 @@
To take it even further, you can even make all DateTime elements automatically
get an appropriate Strftime deflator and a DateTime inflator:
- element_args:
+ default_args:
elements:
DateTime:
deflators:
@@ -1542,7 +1544,7 @@
which is an alias for L</element> - the keys given to C<default_args> must
be of the plural form, e.g.:
- element_args:
+ default_args:
elements: {}
deflators: {}
filters: {}
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Attribute.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Attribute.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Attribute.pm Fri Aug 22 13:56:02 2008
@@ -311,7 +311,7 @@
=head1 AUTHOR
-Carl Franks, C<cfranks.org>
+Carl Franks, C<cfranks at cpan.org>
Based on the original source code of L<HTML::Widget::Accessor>, by
Sebastian Riedel, C<sri at oook.de>.
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element.pm Fri Aug 22 13:56:02 2008
@@ -29,7 +29,7 @@
__PACKAGE__->mk_accessors(
qw/
- name type filename is_field is_repeatable /
+ name type filename is_field is_block is_repeatable /
);
__PACKAGE__->mk_inherited_accessors(qw/ tt_args render_method /);
@@ -159,6 +159,7 @@
stash => $self->stash,
parent => $self->parent,
form => sub { return shift->{parent}->form },
+ object => $self,
@_ ? %{ $_[0] } : () );
weaken( $render{parent} );
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Block.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Block.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Block.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Block.pm Fri Aug 22 13:56:02 2008
@@ -37,6 +37,7 @@
$self->default_args( {} );
$self->filename('block');
$self->tag('div');
+ $self->is_block(1);
return $self;
}
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Date.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Date.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Date.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Date.pm Fri Aug 22 13:56:02 2008
@@ -604,7 +604,7 @@
=head1 AUTHOR
-Carl Franks, C<cfranks.org>
+Carl Franks, C<cfranks at cpan.org>
=head1 LICENSE
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Hidden.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Hidden.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Hidden.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Hidden.pm Fri Aug 22 13:56:02 2008
@@ -59,7 +59,7 @@
=head1 AUTHOR
-Carl Franks, C<cfranks.org>
+Carl Franks, C<cfranks at cpan.org>
=head1 LICENSE
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Multi.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Multi.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Multi.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Multi.pm Fri Aug 22 13:56:02 2008
@@ -42,7 +42,6 @@
$self->label_attributes( {} );
$self->label_filename('label');
$self->label_tag('label');
- $self->is_field(0);
return $self;
}
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Repeatable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Repeatable.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Repeatable.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/Repeatable.pm Fri Aug 22 13:56:02 2008
@@ -114,7 +114,7 @@
sub _reparent_children {
my $self = shift;
- return if $self->is_field;
+ return if !$self->is_block;
for my $child ( @{ $self->get_elements } ) {
$child->parent($self);
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_DateSelect.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_DateSelect.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_DateSelect.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_DateSelect.pm Fri Aug 22 13:56:02 2008
@@ -18,8 +18,14 @@
while ( defined $parent->parent ) {
$parent = $parent->parent;
- push @names, $parent->nested_name
- if defined $parent->nested_name;
+ if ( $parent->can('is_field') && $parent->is_field ) {
+ push @names, $parent->name
+ if defined $parent->name;
+ }
+ else {
+ push @names, $parent->nested_name
+ if defined $parent->nested_name;
+ }
}
if (@names) {
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_Field.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_Field.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_Field.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/Element/_Field.pm Fri Aug 22 13:56:02 2008
@@ -98,10 +98,17 @@
croak 'cannot set nested' if @_;
if ( defined $self->name ) {
- while ( defined $self->parent ) {
- $self = $self->parent;
-
- return 1 if defined $self->nested_name;
+ my $parent = $self;
+
+ while ( defined $parent->parent ) {
+ $parent = $parent->parent;
+
+ if ( $parent->can('is_field') && $parent->is_field ) {
+ return 1 if defined $parent->name;
+ }
+ else {
+ return 1 if defined $parent->nested_name;
+ }
}
}
@@ -139,8 +146,14 @@
while ( defined $parent->parent ) {
$parent = $parent->parent;
- push @names, $parent->nested_name
- if defined $parent->nested_name;
+ if ( $parent->can('is_field') && $parent->is_field ) {
+ push @names, $parent->name
+ if defined $parent->name;
+ }
+ else {
+ push @names, $parent->nested_name
+ if defined $parent->nested_name;
+ }
}
if (@names) {
Modified: trunk/libhtml-formfu-perl/lib/HTML/FormFu/ObjectUtil.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-formfu-perl/lib/HTML/FormFu/ObjectUtil.pm?rev=24464&op=diff
==============================================================================
--- trunk/libhtml-formfu-perl/lib/HTML/FormFu/ObjectUtil.pm (original)
+++ trunk/libhtml-formfu-perl/lib/HTML/FormFu/ObjectUtil.pm Fri Aug 22 13:56:02 2008
@@ -204,8 +204,8 @@
my $self = shift;
my %args = _parse_args(@_);
- my @e
- = map { $_->is_field ? $_ : @{ $_->get_fields } } @{ $self->_elements };
+ my @e = map { $_->is_field && !$_->is_block ? $_ : @{ $_->get_fields } }
+ @{ $self->_elements };
return _get_elements( \%args, \@e );
}
More information about the Pkg-perl-cvs-commits
mailing list