diff -Nru libhtml-formfu-model-dbic-perl-2.00/Changes libhtml-formfu-model-dbic-perl-2.03/Changes --- libhtml-formfu-model-dbic-perl-2.00/Changes 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/Changes 2018-04-09 21:56:30.000000000 +0000 @@ -1,3 +1,17 @@ +2.03 2018-04-09 21:56:26+00:00 UTC + + - New 'expand_stash_dots' config option + + - remove bundled/renamed MooseX::Attribute::Chained and depend on the + fixed version + +2.02 2016-06-24 + + - documentation fixes + + - build and packaging tweaks, including travis CI config, additional + author tests, packaging etc + 2.00 2014-05-05 - switch from MooseX::Attribute::Chained to MooseX::Attribute::FormFuChained diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/changelog libhtml-formfu-model-dbic-perl-2.03/debian/changelog --- libhtml-formfu-model-dbic-perl-2.00/debian/changelog 2016-02-22 07:45:16.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/changelog 2018-05-14 19:15:46.000000000 +0000 @@ -1,3 +1,33 @@ +libhtml-formfu-model-dbic-perl (2.03-2) unstable; urgency=medium + + * Add missing version on MooseX::Attribute::Chained dependency + + -- Florian Schlichting Mon, 14 May 2018 21:15:46 +0200 + +libhtml-formfu-model-dbic-perl (2.03-1) unstable; urgency=medium + + [ gregor herrmann ] + * debian/copyright: change Copyright-Format 1.0 URL to HTTPS. + * Remove Brian Cassidy from Uploaders. Thanks for your work! + + [ Florian Schlichting ] + * Add upstream metadata + * New upstream release: 2.02 + * Update copyright years + * Drop whatis-entries.diff, applied upstream + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ Florian Schlichting ] + * Import upstream version 2.03 + * Update upstream metadata + * Refresh how-to-report-bugs.diff (offset) + * Declare compliance with Debian Policy 4.1.4 + * Re-add libmoosex-attribute-chained-perl dependency + + -- Florian Schlichting Mon, 14 May 2018 16:31:15 +0200 + libhtml-formfu-model-dbic-perl (2.00-2) unstable; urgency=medium * Team upload diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/control libhtml-formfu-model-dbic-perl-2.03/debian/control --- libhtml-formfu-model-dbic-perl-2.00/debian/control 2016-02-22 07:44:32.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/control 2018-05-14 19:14:51.000000000 +0000 @@ -1,7 +1,6 @@ Source: libhtml-formfu-model-dbic-perl Maintainer: Debian Perl Group Uploaders: Ansgar Burchardt , - Brian Cassidy , gregor herrmann , Florian Schlichting Section: perl @@ -15,13 +14,14 @@ libdbix-class-perl, libhtml-formfu-perl (>= 2.00000), liblist-moreutils-perl, + libmoosex-attribute-chained-perl (>= 1.0.2), libsql-translator-perl, libtask-weaken-perl, perl (>= 5.19.5) | libtest-simple-perl (>= 0.99), libyaml-syck-perl -Standards-Version: 3.9.7 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libhtml-formfu-model-dbic-perl.git -Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libhtml-formfu-model-dbic-perl.git +Standards-Version: 4.1.4 +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libhtml-formfu-model-dbic-perl +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libhtml-formfu-model-dbic-perl.git Homepage: http://www.formfu.org/ Package: libhtml-formfu-model-dbic-perl @@ -32,6 +32,7 @@ libdbix-class-perl, libhtml-formfu-perl (>= 2.00000), liblist-moreutils-perl, + libmoosex-attribute-chained-perl (>= 1.0.2), libtask-weaken-perl Description: module to integrate HTML::FormFu with DBIx::Class HTML::FormFu is a HTML form creation, rendering and validation framework. diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/copyright libhtml-formfu-model-dbic-perl-2.03/debian/copyright --- libhtml-formfu-model-dbic-perl-2.00/debian/copyright 2016-02-22 07:44:32.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/copyright 2016-10-09 22:25:06.000000000 +0000 @@ -1,15 +1,15 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: HTML-FormFu-Model-DBIC Upstream-Contact: Carl Franks Source: https://metacpan.org/release/HTML-FormFu-Model-DBIC Files: * -Copyright: 2013, Carl Franks +Copyright: 2016, Carl Franks License: Artistic or GPL-1+ Files: debian/* Copyright: 2008-2011, Ansgar Burchardt - 2013, Florian Schlichting + 2013-2016, Florian Schlichting License: Artistic or GPL-1+ License: Artistic diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/patches/how-to-report-bugs.diff libhtml-formfu-model-dbic-perl-2.03/debian/patches/how-to-report-bugs.diff --- libhtml-formfu-model-dbic-perl-2.00/debian/patches/how-to-report-bugs.diff 2016-02-22 07:44:32.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/patches/how-to-report-bugs.diff 2018-05-14 14:29:38.000000000 +0000 @@ -4,19 +4,18 @@ --- a/lib/HTML/FormFu/Model/DBIC.pm +++ b/lib/HTML/FormFu/Model/DBIC.pm -@@ -1885,9 +1885,13 @@ +@@ -1952,9 +1952,13 @@ =head1 BUGS --Please submit bugs / feature requests to --L (preferred) or --L. +-Please submit bugs / feature requests to +Please submit bug reports to the Debian Bug Tracker. You can use +L to do so interactively. A list of reported bugs can be found +at L. + +For upstream bug reports / feature requests look at -+L (preferred) or + L (preferred) or +-L. +L. =head1 GITHUB REPOSITORY diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/patches/series libhtml-formfu-model-dbic-perl-2.03/debian/patches/series --- libhtml-formfu-model-dbic-perl-2.00/debian/patches/series 2016-02-22 07:51:05.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/patches/series 2016-10-09 22:29:10.000000000 +0000 @@ -1,2 +1 @@ how-to-report-bugs.diff -whatis-entries.diff diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/patches/whatis-entries.diff libhtml-formfu-model-dbic-perl-2.03/debian/patches/whatis-entries.diff --- libhtml-formfu-model-dbic-perl-2.00/debian/patches/whatis-entries.diff 2016-02-22 07:44:32.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/patches/whatis-entries.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -From: Ansgar Burchardt -Date: Tue, 12 Oct 2010 18:14:39 +0200 -Subject: Add whatis entries to man pages -Forwarded: https://github.com/fireartist/HTML-FormFu-Model-DBIC/pull/6/files - ---- a/lib/HTML/FormFu/Constraint/DBIC/Unique.pm -+++ b/lib/HTML/FormFu/Constraint/DBIC/Unique.pm -@@ -161,7 +161,7 @@ - - =head1 NAME - --HTML::FormFu::Constraint::DBIC::Unique -+HTML::FormFu::Constraint::DBIC::Unique - unique constraint for HTML::FormFu::Model::DBIC - - =head1 SYNOPSIS - diff -Nru libhtml-formfu-model-dbic-perl-2.00/debian/upstream/metadata libhtml-formfu-model-dbic-perl-2.03/debian/upstream/metadata --- libhtml-formfu-model-dbic-perl-2.00/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/debian/upstream/metadata 2018-05-14 14:28:32.000000000 +0000 @@ -0,0 +1,6 @@ +--- +Archive: CPAN +Contact: Carl Franks +Name: HTML-FormFu-Model-DBIC +Repository: https://github.com/FormFu/HTML-FormFu-Model-DBIC.git +Repository-Browse: https://github.com/FormFu/HTML-FormFu-Model-DBIC diff -Nru libhtml-formfu-model-dbic-perl-2.00/dist.ini libhtml-formfu-model-dbic-perl-2.03/dist.ini --- libhtml-formfu-model-dbic-perl-2.00/dist.ini 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/dist.ini 2018-04-09 21:56:30.000000000 +0000 @@ -2,9 +2,7 @@ author = Carl Franks license = Perl_5 copyright_holder = Carl Franks -copyright_year = 2013 - -version = 2.00 +copyright_year = 2016 [Prereqs] perl = 5.008001 @@ -12,6 +10,7 @@ DBIx::Class = 0.08108 HTML::FormFu = 2.00 List::MoreUtils = 0 +MooseX::Attribute::Chained = 1.0.2 Storable = 0 Task::Weaken = 0 ; make sure Scalar::Util has weaken() @@ -24,14 +23,42 @@ [Prereqs / DevelopRequires] Test::Pod = 0 -[PodCoverageTests] -[PodSyntaxTests] - -[PkgVersion] - -[NextRelease] -format = %v %{yyyy-MM-dd}d - -[Repository] - -[@Basic] +;; -- +;; -- Sets of additional tests we want to do as part of release +[Test::Perl::Critic] +[MetaTests] +;; [PodCoverageTests] ; Currently we comprehensively fail these +[OurPkgVersion] +[PodVersion] +[Test::Kwalitee] +[Test::EOL] +finder = :InstallModules ; prevents test inputs being flagged +[Test::PAUSE::Permissions] ; if doing a release make sure we have PAUSE perms + +;; -- Additional information +[GithubMeta] ; Grab the repo metadata +[NextRelease] ; Mark up the next release in changes + +;; -- Additional git +[Git::GatherDir] +[Git::NextVersion] ; Get the next version tag from git +[Git::CheckFor::CorrectBranch] ; ensure on master branch for release +[Git::Remote::Check] ; ensure our branch is ahead of remote + +;; -- We base the release stuff on the starter module, and tweak a bit +[@Starter] +-remove = GatherDir ; this is replaced by [Git::GatherDir] +ReadmeAnyFromPod.source_filename = lib/HTML/FormFu/Model/DBIC.pm + +[ReadmeAnyFromPod / Pod_Readme] +type = pod +location = root ; do not include pod readmes in the build! + +[@Git] +changelog = Changes +allow_dirty = dist.ini +allow_dirty = README.pod +allow_dirty = Changes +commit_msg = v%v%t - %d%n%n%c +tag_format = v%v%t ; see Git::Tag +tag_message = v%v%t - %d ; see Git::Tag \ No newline at end of file diff -Nru libhtml-formfu-model-dbic-perl-2.00/lib/HTML/FormFu/Constraint/DBIC/Unique.pm libhtml-formfu-model-dbic-perl-2.03/lib/HTML/FormFu/Constraint/DBIC/Unique.pm --- libhtml-formfu-model-dbic-perl-2.00/lib/HTML/FormFu/Constraint/DBIC/Unique.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/lib/HTML/FormFu/Constraint/DBIC/Unique.pm 2018-04-09 21:56:30.000000000 +0000 @@ -1,7 +1,10 @@ package HTML::FormFu::Constraint::DBIC::Unique; -$HTML::FormFu::Constraint::DBIC::Unique::VERSION = '2.00'; + +use strict; +our $VERSION = '2.03'; # VERSION + use Moose; -use MooseX::Attribute::FormFuChained; +use MooseX::Attribute::Chained; extends 'HTML::FormFu::Constraint'; @@ -9,13 +12,13 @@ use HTML::FormFu::Util qw( DEBUG_CONSTRAINTS debug ); -has model => ( is => 'rw', traits => ['FormFuChained'] ); -has resultset => ( is => 'rw', traits => ['FormFuChained'] ); -has column => ( is => 'rw', traits => ['FormFuChained'] ); -has method_name => ( is => 'rw', traits => ['FormFuChained'] ); -has self_stash_key => ( is => 'rw', traits => ['FormFuChained'] ); -has others => ( is => 'rw', traits => ['FormFuChained'] ); -has id_field => ( is => 'rw', traits => ['FormFuChained'] ); +has model => ( is => 'rw', traits => ['Chained'] ); +has resultset => ( is => 'rw', traits => ['Chained'] ); +has column => ( is => 'rw', traits => ['Chained'] ); +has method_name => ( is => 'rw', traits => ['Chained'] ); +has self_stash_key => ( is => 'rw', traits => ['Chained'] ); +has others => ( is => 'rw', traits => ['Chained'] ); +has id_field => ( is => 'rw', traits => ['Chained'] ); sub constrain_value { my ( $self, $value ) = @_; @@ -30,9 +33,9 @@ } } - # get stash + # get stash my $stash = $self->form->stash; - + my $schema; if ( defined $stash->{schema} ) { @@ -70,13 +73,13 @@ if ( defined( my $self_stash = $stash->{ $self_stash_key } ) ) { my ($pk) = $resultset->result_source->primary_columns; - + $pk_val = $self_stash->$pk; } } return $resultset->$method_name( $value, $pk_val ); - } + } else { my $column = $self->column || $self->parent->name; @@ -84,7 +87,7 @@ if ( $self->others ) { my @others = ref $self->others ? @{ $self->others } : $self->others; - + my $params = $self->form->input; %others = @@ -94,28 +97,28 @@ map { $_ => $self->get_nested_hash_value( $params, $_ ) } @others; - + } - + my $existing_row = eval { $resultset->find( { %others, $column => $value } ); }; - + if ( my $error = $@ ) { # warn and die, as errors are swallowed by HTML-FormFu carp $error; croak $error; } - + # if a row exists, first check whether it matches a known object on the # form stash - + if ( $existing_row && defined( my $self_stash_key = $self->self_stash_key ) ) { - + if ( defined( my $self_stash = $stash->{ $self_stash_key } ) ) { - + my ($pk) = $resultset->result_source->primary_columns; - + if ( $existing_row->$pk eq $self_stash->$pk ) { return 1; } @@ -128,7 +131,7 @@ return ($existing_row->$pk eq $value); } } - + return !$existing_row; } @@ -136,11 +139,11 @@ after repeatable_repeat => sub { my ( $self, $repeatable, $new_block ) = @_; - + # rename any 'id_field' fields if ( my $id_field = $self->id_field ) { my $block_fields = $new_block->get_fields; - + my $field = $repeatable->get_field_with_original_name( $id_field, $block_fields ); if ( defined $field ) { @@ -161,11 +164,15 @@ =head1 NAME -HTML::FormFu::Constraint::DBIC::Unique +HTML::FormFu::Constraint::DBIC::Unique - unique constraint for HTML::FormFu::Model::DBIC + +=head1 VERSION + +version 2.03 =head1 SYNOPSIS - $form->stash->{schema} = $dbic_schema; # DBIC schema + $form->stash->{schema} = $dbic_schema; # DBIC schema $form->element('text') ->name('email') @@ -192,7 +199,7 @@ or in a config file: --- - elements: + elements: - type: text name: email constraints: @@ -201,7 +208,7 @@ model: DBIC::User - type: text name: user - constraints: + constraints: - Required - type: DBIC::Unique model: DBIC::User @@ -225,7 +232,7 @@ =head2 self_stash_key reference to a key in the form stash. if this key exists, the constraint -will check if the id matches the one of this element, so that you can +will check if the id matches the one of this element, so that you can use your own name. =head2 id_field @@ -257,13 +264,13 @@ 'category' and 'value', use a config file such as this: --- - elements: + elements: - type: Text name: category label: Category constraints: - Required - + - type: Text name: value label: Value @@ -277,14 +284,14 @@ Name of a method which will be called on the resultset. The method is passed two argument; the value of the field, and the primary key value (usually `id`) -of the record in the form stash (as defined by self_stash_key). An example +of the record in the form stash (as defined by self_stash_key). An example config might be: --- - elements: + elements: - type: text name: user - constraints: + constraints: - Required - type: DBIC::Unique model: DBIC::User diff -Nru libhtml-formfu-model-dbic-perl-2.00/lib/HTML/FormFu/Model/DBIC.pm libhtml-formfu-model-dbic-perl-2.03/lib/HTML/FormFu/Model/DBIC.pm --- libhtml-formfu-model-dbic-perl-2.00/lib/HTML/FormFu/Model/DBIC.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/lib/HTML/FormFu/Model/DBIC.pm 2018-04-09 21:56:30.000000000 +0000 @@ -1,13 +1,15 @@ package HTML::FormFu::Model::DBIC; -$HTML::FormFu::Model::DBIC::VERSION = '2.00'; + use strict; use warnings; use base 'HTML::FormFu::Model'; +our $VERSION = '2.03'; # VERSION + use HTML::FormFu::Util qw( _merge_hashes ); use List::MoreUtils qw( none notall ); use List::Util qw( first ); -use Scalar::Util qw( blessed ); +use Scalar::Util qw( blessed reftype ); use Storable qw( dclone ); use Carp qw( croak ); @@ -59,8 +61,12 @@ : {}; # avoid overwriting attrs->{condition} for my $name ( keys %$from_stash ) { croak "config value must not be a reference" if ref $from_stash->{$name}; - my $value = $form->stash->{ $from_stash->{$name} }; - $condition->{$name} = $value; + if ( $attrs->{expand_stash_dots} ) { + $condition->{$name} = $self->_get_stash_value( $form->stash, $from_stash->{$name} ); + } + else { + $condition->{$name} = $form->stash->{ $from_stash->{$name} }; + } } } @@ -92,6 +98,30 @@ return @defaults; } +sub _get_stash_value { + my ( $self, $stash, $key ) = @_; + my $base = $stash; + + if ( $key =~ /\./ ) { + for my $part ( grep {length} split qr/\./, $key ) { + if ( blessed($base) && $base->can($part) ) { + $base = $base->$part; + } + elsif ( 'HASH' eq reftype($base) ) { + $base = $base->{$part}; + } + elsif ( 'ARRAY' eq reftype($base) && $key =~ /^[0-9]+\z/ ) { + $base = $base->[$key]; + } + else { + croak "don't know what to do with part '$part' in key '$key'"; + } + } + } + + return $base; +} + sub _get_resultset { my ( $base, $form, $attrs ) = @_; @@ -352,7 +382,7 @@ my $schema = $form->stash->{schema} or croak 'schema required on form stash, if no row object provided'; - my $resultset + my $resultset = $attrs->{resultset} || $base->model_config->{resultset} || $form->model_config->{resultset} @@ -591,19 +621,19 @@ sub _save_combobox { my ( $self, $base, $dbic, $form, $rs, $combo, $rel, $attrs ) = @_; - + my $select = $combo->get_field({ type => 'Select' }); my $text = $combo->get_field({ type => 'Text' }); - + my $select_value = $form->param( $select->nested_name ); my $text_value = $form->param( $text->nested_name ); - + my $target_rs = $dbic->result_source->related_source( $rel )->resultset; my $target; - + if ( defined $select_value && length $select_value ) { my $pk_name = $combo->model_config->{select_column}; - + $target = $target_rs->find( { $pk_name => $select_value, @@ -612,14 +642,14 @@ } else { my $column_name = $combo->model_config->{text_column}; - + $target = $target_rs->create( { $column_name => $text_value, }, ); } - + $dbic->set_from_related( $rel, $target ); $dbic->update; } @@ -818,7 +848,7 @@ ) or $field->model_config->{null_if_empty} ) # comparing to '' does not work for inflated objects - && !ref $value + && !ref $value && $value eq '' ) { @@ -852,12 +882,12 @@ my $accessor = $config->{accessor} || $name; next if not defined $accessor; - - my $value = ( $dbic->result_source->has_column($accessor) + + my $value = ( $dbic->result_source->has_column($accessor) and exists $dbic->result_source->column_info($accessor)->{is_array} ) ? $form->param_array( $field->nested_name ) : $form->param_value( $field->nested_name ) ; - + next if $config->{ignore_if_empty} && ( !defined $value || $value eq "" ); @@ -895,7 +925,8 @@ $dbic->can($accessor) # and $accessor is not a has_one or might_have rel where the foreign key is on the foreign table - and !$dbic->result_source->relationship_info($accessor) ) + and !$dbic->result_source->relationship_info($accessor) + and !$dbic->can( 'add_to_' . $accessor ) ) { $dbic->$accessor($value); } @@ -1044,7 +1075,7 @@ my $is_new; my $config = $block->model_config; - my $new_rows_max + my $new_rows_max = $config->{new_rows_max} || $config->{empty_rows} || 0; @@ -1139,32 +1170,36 @@ HTML::FormFu::Model::DBIC - Integrate HTML::FormFu with DBIx::Class +=head1 VERSION + +version 2.03 + =head1 SYNOPSIS Example of typical use in a Catalyst controller: sub edit : Chained { my ( $self, $c ) = @_; - + my $form = $c->stash->{form}; my $book = $c->stash->{book}; - + if ( $form->submitted_and_valid ) { - + # update dbic row with submitted values from form - + $form->model->update( $book ); - + $c->response->redirect( $c->uri_for('view', $book->id) ); return; } elsif ( !$form->submitted ) { - + # use dbic row to set form's default values - + $form->model->default_values( $book ); } - + return; } @@ -1234,7 +1269,7 @@ --- model_config: resultset: FooTable - + elements: # [snip] @@ -1277,20 +1312,20 @@ package MySchema::Book; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("book"); - + __PACKAGE__->add_columns( id => { data_type => "INTEGER" }, title => { data_type => "TEXT" }, author => { data_type => "TEXT" }, blurb => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("id"); - + 1; A suitable form for this might be: @@ -1298,18 +1333,18 @@ elements: - type: Text name: title - + - type: Text name: author - + - type: Textarea name: blurb =head2 might_have and has_one relationships -Set field values from a related row with a C or C -relationship by placing the fields within a -L (or any element that inherits from +Set field values from a related row with a C or C +relationship by placing the fields within a +L (or any element that inherits from Block, such as L) with its L set to the relationship name. @@ -1317,40 +1352,40 @@ package MySchema::Book; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("book"); - + __PACKAGE__->add_columns( id => { data_type => "INTEGER" }, title => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("id"); - + __PACKAGE__->might_have( review => 'MySchema::Review', 'book' ); - + 1; package MySchema::Review; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("review"); - + __PACKAGE__->add_columns( id => { data_type => "INTEGER" }, book => { data_type => "INTEGER", is_nullable => 1 }, review_text => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("book"); - + __PACKAGE__->belongs_to( book => 'MySchema::Book' ); - + 1; A suitable form for this would be: @@ -1358,7 +1393,7 @@ elements: - type: Text name: title - + - type: Block nested_name: review elements: @@ -1370,20 +1405,20 @@ handle retrieving the correct row automatically. You can also set a C or C relationship using a multi value -field like L. +field like L. elements: - type: Text name: title - + - type: Select nested: review model_config: resultset: Review This will load all reviews into the select field. If you select a review from -that list, a current relationship to a review is removed and the new one is -added. This requires that the primary key of the C table and the +that list, a current relationship to a review is removed and the new one is +added. This requires that the primary key of the C table and the foreign key do not match. =head2 has_many and many_to_many relationships @@ -1391,7 +1426,8 @@ The general principle is the same as for C and C above, except you should use a L element instead of a Block, and it needs to contain a -L field corresponding to the foreign key. +L field corresponding to the primary key +of the related table. The Repeatable block's L must be set to the @@ -1418,39 +1454,39 @@ package MySchema::Book; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("book"); - + __PACKAGE__->add_columns( id => { data_type => "INTEGER" }, title => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("id"); - + __PACKAGE__->has_many( review => 'MySchema::Review', 'book' ); - + 1; package MySchema::Review; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("review"); - + __PACKAGE__->add_columns( book => { data_type => "INTEGER" }, review_text => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("book"); - + __PACKAGE__->belongs_to( book => 'MySchema::Book' ); - + 1; A suitable form for this might be: @@ -1458,10 +1494,10 @@ elements: - type: Text name: title - + - type: Hidden name: review_count - + - type: Repeatable nested_name: review counter_name: review_count @@ -1470,7 +1506,7 @@ elements: - type: Hidden name: book - + - type: Textarea name: review_text @@ -1499,12 +1535,12 @@ =head2 many_to_many selection To select / deselect rows from a C relationship, you must use -a multi-valued element, such as a +a multi-valued element, such as a L or a -L with +L with L set. -The field's L must be set to the +The field's L must be set to the name of the C relationship. =head3 default_column @@ -1521,7 +1557,7 @@ =head3 link_values -If you want to set columns on the link table you can do so if you add a +If you want to set columns on the link table you can do so if you add a C attribute to C: --- @@ -1603,7 +1639,7 @@ =item null_if_empty -If the submitted value is blank, save it as NULL to the database. Normally an empty string is saved as NULL when its corresponding field is numeric, and as an empty string when its corresponding field is a text field. This option is useful for changing the default behavior for text fields. +If the submitted value is blank, save it as NULL to the database. Normally an empty string is saved as NULL when its corresponding field is numeric, and as an empty string when its corresponding field is a text field. This option is useful for changing the default behavior for text fields. =item delete_if_empty @@ -1615,39 +1651,39 @@ package MySchema::Book; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("book"); - + __PACKAGE__->add_columns( id => { data_type => "INTEGER" }, title => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("id"); - + __PACKAGE__->might_have( review => 'MySchema::Review', 'book' ); - + 1; package MySchema::Review; use base 'DBIx::Class'; - + __PACKAGE__->load_components(qw/ Core /); - + __PACKAGE__->table("review"); - + __PACKAGE__->add_columns( book => { data_type => "INTEGER" }, review_text => { data_type => "TEXT" }, ); - + __PACKAGE__->set_primary_key("book"); - + __PACKAGE__->belongs_to( book => 'MySchema::Book' ); - + 1; A suitable form for this would be: @@ -1655,7 +1691,7 @@ elements: - type: Text name: title - + - type: Block nested_name: review elements: @@ -1688,20 +1724,20 @@ elements: - type: Text name: title - + - type: Hidden name: review_count - + - type: Repeatable nested_name: review counter_name: review_count elements: - type: Hidden name: book - + - type: Textarea name: review_text - + - type: Checkbox name: delete_review label: 'Delete Review?' @@ -1807,6 +1843,37 @@ } }) +If the value in the stash is nested in a data-structure, you can access it by +setting C. As you can see in the example below, it +automatically handles calling methods on objects, accessing hash-keys on +hash-references, and accessing array-slots on array references. + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + condition_from_stash: + key: foo.bar.0 + expand_stash_dots: 1 + +Is comparable to: + + $form->element({ + type => 'Select', + name => 'foo', + model_config => { + resultset => 'TableClass', + condition => { + key => $form->stash->{foo}->bar->[0]; + } + } + }) + # Where stash returns a hashref. + # The 'foo' hash-key returns an object. + # The object-method 'bar' returns an arrayref. + # The first array slot returns the value used in the query. + You can set C, which will be passed as the 2nd argument to L. @@ -1821,13 +1888,13 @@ =head2 Add extra values not in the form -To update values to the database which weren't submitted to the form, +To update values to the database which weren't submitted to the form, you can first add them to the form with L. my $passwd = generate_passwd(); - + $form->add_valid( passwd => $passwd ); - + $form->model->update( $row ); C works for fieldnames that don't exist in the form. @@ -1838,7 +1905,7 @@ the user even if they submit a value for it. $field->model_config->{read_only} = 1; - + - Name: field model_config: read_only: 1 @@ -1847,12 +1914,12 @@ =head1 CAVEATS -To ensure your column's inflators and deflators are called, we have to -get / set values using their named methods, and not with C / +To ensure your column's inflators and deflators are called, we have to +get / set values using their named methods, and not with C / C. -Because of this, beware of having column names which clash with DBIx::Class -built-in method-names, such as C. - It will have obviously +Because of this, beware of having column names which clash with DBIx::Class +built-in method-names, such as C. - It will have obviously undesirable results! =head1 REMOVED METHODS @@ -1885,8 +1952,8 @@ =head1 BUGS -Please submit bugs / feature requests to -L (preferred) or +Please submit bugs / feature requests to +L (preferred) or L. =head1 GITHUB REPOSITORY @@ -1919,7 +1986,7 @@ Copyright (C) 2007 by Carl Franks -Based on the original source code of L, copyright +Based on the original source code of L, copyright Thomas Klausner. This library is free software; you can redistribute it and/or modify diff -Nru libhtml-formfu-model-dbic-perl-2.00/LICENSE libhtml-formfu-model-dbic-perl-2.03/LICENSE --- libhtml-formfu-model-dbic-perl-2.00/LICENSE 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/LICENSE 2018-04-09 21:56:30.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2013 by Carl Franks. +This software is copyright (c) 2016 by Carl Franks. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2013 by Carl Franks. +This software is Copyright (c) 2016 by Carl Franks. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2013 by Carl Franks. +This software is Copyright (c) 2016 by Carl Franks. This is free software, licensed under: diff -Nru libhtml-formfu-model-dbic-perl-2.00/Makefile.PL libhtml-formfu-model-dbic-perl-2.03/Makefile.PL --- libhtml-formfu-model-dbic-perl-2.00/Makefile.PL 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/Makefile.PL 2018-04-09 21:56:30.000000000 +0000 @@ -1,42 +1,41 @@ - -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.015. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.011. use strict; use warnings; use 5.008001; -use ExtUtils::MakeMaker 6.30; - - +use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Integrate HTML::FormFu with DBIx::Class", "AUTHOR" => "Carl Franks ", - "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { - "ExtUtils::MakeMaker" => "6.30" + "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "HTML-FormFu-Model-DBIC", - "EXE_FILES" => [], "LICENSE" => "perl", + "MIN_PERL_VERSION" => "5.008001", "NAME" => "HTML::FormFu::Model::DBIC", "PREREQ_PM" => { "DBD::SQLite" => 0, "DBIx::Class" => "0.08108", "HTML::FormFu" => "2.00", "List::MoreUtils" => 0, + "MooseX::Attribute::Chained" => "1.0.2", "Storable" => 0, "Task::Weaken" => 0 }, "TEST_REQUIRES" => { "DateTime::Format::SQLite" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0, "Locale::Maketext" => 0, "SQL::Translator" => "0.11016", "Test::More" => "0.99" }, - "VERSION" => "2.00", + "VERSION" => "2.03", "test" => { - "TESTS" => "t/constraints/*.t t/create/*.t t/default_values/*.t t/options_from_model/*.t t/update/*.t t/x_roundtrip/*.t" + "TESTS" => "t/*.t t/constraints/*.t t/create/*.t t/default_values/*.t t/options_from_model/*.t t/update/*.t t/x_roundtrip/*.t" } ); @@ -45,9 +44,12 @@ "DBD::SQLite" => 0, "DBIx::Class" => "0.08108", "DateTime::Format::SQLite" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0, "HTML::FormFu" => "2.00", "List::MoreUtils" => 0, "Locale::Maketext" => 0, + "MooseX::Attribute::Chained" => "1.0.2", "SQL::Translator" => "0.11016", "Storable" => 0, "Task::Weaken" => 0, @@ -65,6 +67,3 @@ unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); - - - diff -Nru libhtml-formfu-model-dbic-perl-2.00/MANIFEST libhtml-formfu-model-dbic-perl-2.03/MANIFEST --- libhtml-formfu-model-dbic-perl-2.00/MANIFEST 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/MANIFEST 2018-04-09 21:56:30.000000000 +0000 @@ -1,13 +1,16 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.015. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.011. Changes LICENSE MANIFEST +META.json META.yml Makefile.PL README dist.ini lib/HTML/FormFu/Constraint/DBIC/Unique.pm lib/HTML/FormFu/Model/DBIC.pm +t/00-report-prereqs.dd +t/00-report-prereqs.t t/constraints/dbic_unique.t t/constraints/dbic_unique.yml t/constraints/dbic_unique_column.yml @@ -111,6 +114,8 @@ t/options_from_model/condition_from_stash_combobox.yml t/options_from_model/condition_from_stash_combobox_complex.t t/options_from_model/condition_from_stash_complex.t +t/options_from_model/condition_from_stash_expand.t +t/options_from_model/condition_from_stash_expand.yml t/options_from_model/constraint_autoset.t t/options_from_model/constraint_autoset.yml t/options_from_model/enum_select.t @@ -202,3 +207,10 @@ t/x_roundtrip/checkbox.yml t/x_roundtrip/checkbox_false2true.t t/x_roundtrip/checkbox_true2false.t +xt/author/00-compile.t +xt/author/critic.t +xt/author/eol.t +xt/author/pod-syntax.t +xt/release/distmeta.t +xt/release/kwalitee.t +xt/release/pause-permissions.t diff -Nru libhtml-formfu-model-dbic-perl-2.00/META.json libhtml-formfu-model-dbic-perl-2.03/META.json --- libhtml-formfu-model-dbic-perl-2.00/META.json 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/META.json 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,561 @@ +{ + "abstract" : "Integrate HTML::FormFu with DBIx::Class", + "author" : [ + "Carl Franks " + ], + "dynamic_config" : 0, + "generated_by" : "Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : 2 + }, + "name" : "HTML-FormFu-Model-DBIC", + "no_index" : { + "directory" : [ + "eg", + "examples", + "inc", + "share", + "t", + "xt" + ] + }, + "prereqs" : { + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "0" + } + }, + "develop" : { + "requires" : { + "File::Spec" : "0", + "IO::Handle" : "0", + "IPC::Open3" : "0", + "Test::CPAN::Meta" : "0", + "Test::EOL" : "0", + "Test::Kwalitee" : "1.21", + "Test::More" : "0.88", + "Test::PAUSE::Permissions" : "0", + "Test::Perl::Critic" : "0", + "Test::Pod" : "1.41" + } + }, + "runtime" : { + "requires" : { + "DBD::SQLite" : "0", + "DBIx::Class" : "0.08108", + "HTML::FormFu" : "2.00", + "List::MoreUtils" : "0", + "MooseX::Attribute::Chained" : "v1.0.2", + "Storable" : "0", + "Task::Weaken" : "0", + "perl" : "5.008001" + } + }, + "test" : { + "recommends" : { + "CPAN::Meta" : "2.120900" + }, + "requires" : { + "DateTime::Format::SQLite" : "0", + "ExtUtils::MakeMaker" : "0", + "File::Spec" : "0", + "Locale::Maketext" : "0", + "SQL::Translator" : "0.11016", + "Test::More" : "0.99" + } + } + }, + "provides" : { + "HTML::FormFu::Constraint::DBIC::Unique" : { + "file" : "lib/HTML/FormFu/Constraint/DBIC/Unique.pm", + "version" : "2.03" + }, + "HTML::FormFu::Model::DBIC" : { + "file" : "lib/HTML/FormFu/Model/DBIC.pm", + "version" : "2.03" + } + }, + "release_status" : "stable", + "resources" : { + "homepage" : "https://github.com/FormFu/HTML-FormFu-Model-DBIC", + "repository" : { + "type" : "git", + "url" : "https://github.com/FormFu/HTML-FormFu-Model-DBIC.git", + "web" : "https://github.com/FormFu/HTML-FormFu-Model-DBIC" + } + }, + "version" : "2.03", + "x_Dist_Zilla" : { + "perl" : { + "version" : "5.014004" + }, + "plugins" : [ + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "runtime", + "type" : "requires" + } + }, + "name" : "Prereqs", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "test", + "type" : "requires" + } + }, + "name" : "TestRequires", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Prereqs", + "config" : { + "Dist::Zilla::Plugin::Prereqs" : { + "phase" : "develop", + "type" : "requires" + } + }, + "name" : "DevelopRequires", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Perl::Critic", + "name" : "Test::Perl::Critic", + "version" : "3.001" + }, + { + "class" : "Dist::Zilla::Plugin::MetaTests", + "name" : "MetaTests", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::OurPkgVersion", + "name" : "OurPkgVersion", + "version" : "0.12" + }, + { + "class" : "Dist::Zilla::Plugin::PodVersion", + "name" : "PodVersion", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Kwalitee", + "config" : { + "Dist::Zilla::Plugin::Test::Kwalitee" : { + "filename" : "xt/release/kwalitee.t", + "skiptest" : [] + } + }, + "name" : "Test::Kwalitee", + "version" : "2.12" + }, + { + "class" : "Dist::Zilla::Plugin::Test::EOL", + "config" : { + "Dist::Zilla::Plugin::Test::EOL" : { + "filename" : "xt/author/eol.t", + "finder" : [ + ":InstallModules" + ], + "trailing_whitespace" : 1 + } + }, + "name" : "Test::EOL", + "version" : "0.19" + }, + { + "class" : "Dist::Zilla::Plugin::Test::PAUSE::Permissions", + "name" : "Test::PAUSE::Permissions", + "version" : "0.003" + }, + { + "class" : "Dist::Zilla::Plugin::GithubMeta", + "name" : "GithubMeta", + "version" : "0.54" + }, + { + "class" : "Dist::Zilla::Plugin::NextRelease", + "name" : "NextRelease", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Git::GatherDir", + "config" : { + "Dist::Zilla::Plugin::GatherDir" : { + "exclude_filename" : [], + "exclude_match" : [], + "follow_symlinks" : 0, + "include_dotfiles" : 0, + "prefix" : "", + "prune_directory" : [], + "root" : "." + }, + "Dist::Zilla::Plugin::Git::GatherDir" : { + "include_untracked" : 0 + } + }, + "name" : "Git::GatherDir", + "version" : "2.043" + }, + { + "class" : "Dist::Zilla::Plugin::Git::NextVersion", + "config" : { + "Dist::Zilla::Plugin::Git::NextVersion" : { + "first_version" : "0.001", + "version_by_branch" : 0, + "version_regexp" : "(?^:^v(.+)$)" + }, + "Dist::Zilla::Role::Git::Repo" : { + "git_version" : "1.9.1", + "repo_root" : "." + } + }, + "name" : "Git::NextVersion", + "version" : "2.043" + }, + { + "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", + "config" : { + "Dist::Zilla::Role::Git::Repo" : { + "git_version" : "1.9.1", + "repo_root" : "." + } + }, + "name" : "Git::CheckFor::CorrectBranch", + "version" : "0.014" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Remote::Check", + "name" : "Git::Remote::Check", + "version" : "0.1.2" + }, + { + "class" : "Dist::Zilla::Plugin::PruneCruft", + "name" : "@Starter/PruneCruft", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::ManifestSkip", + "name" : "@Starter/ManifestSkip", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::MetaConfig", + "name" : "@Starter/MetaConfig", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::MetaProvides::Package", + "config" : { + "Dist::Zilla::Plugin::MetaProvides::Package" : { + "finder_objects" : [ + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : "@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", + "version" : "6.011" + } + ], + "include_underscores" : 0 + }, + "Dist::Zilla::Role::MetaProvider::Provider" : { + "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", + "inherit_missing" : 1, + "inherit_version" : 1, + "meta_noindex" : 1 + }, + "Dist::Zilla::Role::ModuleMetadata" : { + "Module::Metadata" : "1.000033", + "version" : "0.005" + } + }, + "name" : "@Starter/MetaProvides::Package", + "version" : "2.004003" + }, + { + "class" : "Dist::Zilla::Plugin::MetaNoIndex", + "name" : "@Starter/MetaNoIndex", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::MetaYAML", + "name" : "@Starter/MetaYAML", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::MetaJSON", + "name" : "@Starter/MetaJSON", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::License", + "name" : "@Starter/License", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", + "config" : { + "Dist::Zilla::Role::FileWatcher" : { + "version" : "0.006" + } + }, + "name" : "@Starter/ReadmeAnyFromPod", + "version" : "0.163250" + }, + { + "class" : "Dist::Zilla::Plugin::ExecDir", + "name" : "@Starter/ExecDir", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::ShareDir", + "name" : "@Starter/ShareDir", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::PodSyntaxTests", + "name" : "@Starter/PodSyntaxTests", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", + "name" : "@Starter/Test::ReportPrereqs", + "version" : "0.027" + }, + { + "class" : "Dist::Zilla::Plugin::Test::Compile", + "config" : { + "Dist::Zilla::Plugin::Test::Compile" : { + "bail_out_on_fail" : 0, + "fail_on_warning" : "author", + "fake_home" : 0, + "filename" : "xt/author/00-compile.t", + "module_finder" : [ + ":InstallModules" + ], + "needs_display" : 0, + "phase" : "develop", + "script_finder" : [ + ":PerlExecFiles" + ], + "skips" : [], + "switch" : [] + } + }, + "name" : "@Starter/Test::Compile", + "version" : "2.058" + }, + { + "class" : "Dist::Zilla::Plugin::MakeMaker", + "config" : { + "Dist::Zilla::Role::TestRunner" : { + "default_jobs" : 1 + } + }, + "name" : "@Starter/MakeMaker", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::Manifest", + "name" : "@Starter/Manifest", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::TestRelease", + "name" : "@Starter/TestRelease", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::RunExtraTests", + "config" : { + "Dist::Zilla::Role::TestRunner" : { + "default_jobs" : 1 + } + }, + "name" : "@Starter/RunExtraTests", + "version" : "0.029" + }, + { + "class" : "Dist::Zilla::Plugin::ConfirmRelease", + "name" : "@Starter/ConfirmRelease", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::UploadToCPAN", + "name" : "@Starter/UploadToCPAN", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", + "config" : { + "Dist::Zilla::Role::FileWatcher" : { + "version" : "0.006" + } + }, + "name" : "Pod_Readme", + "version" : "0.163250" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Check", + "config" : { + "Dist::Zilla::Plugin::Git::Check" : { + "untracked_files" : "die" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [ + "Changes", + "README.pod", + "dist.ini" + ], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "git_version" : "1.9.1", + "repo_root" : "." + } + }, + "name" : "@Git/Check", + "version" : "2.043" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Commit", + "config" : { + "Dist::Zilla::Plugin::Git::Commit" : { + "add_files_in" : [], + "commit_msg" : "v%v%t - %d%n%n%c" + }, + "Dist::Zilla::Role::Git::DirtyFiles" : { + "allow_dirty" : [ + "Changes", + "README.pod", + "dist.ini" + ], + "allow_dirty_match" : [], + "changelog" : "Changes" + }, + "Dist::Zilla::Role::Git::Repo" : { + "git_version" : "1.9.1", + "repo_root" : "." + }, + "Dist::Zilla::Role::Git::StringFormatter" : { + "time_zone" : "local" + } + }, + "name" : "@Git/Commit", + "version" : "2.043" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Tag", + "config" : { + "Dist::Zilla::Plugin::Git::Tag" : { + "branch" : null, + "changelog" : "Changes", + "signed" : 0, + "tag" : "v2.03", + "tag_format" : "v%v%t", + "tag_message" : "v%v%t - %d" + }, + "Dist::Zilla::Role::Git::Repo" : { + "git_version" : "1.9.1", + "repo_root" : "." + }, + "Dist::Zilla::Role::Git::StringFormatter" : { + "time_zone" : "local" + } + }, + "name" : "@Git/Tag", + "version" : "2.043" + }, + { + "class" : "Dist::Zilla::Plugin::Git::Push", + "config" : { + "Dist::Zilla::Plugin::Git::Push" : { + "push_to" : [ + "origin" + ], + "remotes_must_exist" : 1 + }, + "Dist::Zilla::Role::Git::Repo" : { + "git_version" : "1.9.1", + "repo_root" : "." + } + }, + "name" : "@Git/Push", + "version" : "2.043" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":InstallModules", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":IncModules", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":TestFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ExtraTestFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ExecFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":PerlExecFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":ShareFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":MainModule", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":AllFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : ":NoFiles", + "version" : "6.011" + }, + { + "class" : "Dist::Zilla::Plugin::FinderCode", + "name" : "@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", + "version" : "6.011" + } + ], + "zilla" : { + "class" : "Dist::Zilla::Dist::Builder", + "config" : { + "is_trial" : 0 + }, + "version" : "6.011" + } + }, + "x_serialization_backend" : "Cpanel::JSON::XS version 4.02" +} + diff -Nru libhtml-formfu-model-dbic-perl-2.00/META.yml libhtml-formfu-model-dbic-perl-2.03/META.yml --- libhtml-formfu-model-dbic-perl-2.00/META.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/META.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,26 +4,400 @@ - 'Carl Franks ' build_requires: DateTime::Format::SQLite: '0' + ExtUtils::MakeMaker: '0' + File::Spec: '0' Locale::Maketext: '0' SQL::Translator: '0.11016' Test::More: '0.99' configure_requires: - ExtUtils::MakeMaker: '6.30' + ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 5.015, CPAN::Meta::Converter version 2.140640' +generated_by: 'Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: HTML-FormFu-Model-DBIC +no_index: + directory: + - eg + - examples + - inc + - share + - t + - xt +provides: + HTML::FormFu::Constraint::DBIC::Unique: + file: lib/HTML/FormFu/Constraint/DBIC/Unique.pm + version: '2.03' + HTML::FormFu::Model::DBIC: + file: lib/HTML/FormFu/Model/DBIC.pm + version: '2.03' requires: DBD::SQLite: '0' DBIx::Class: '0.08108' HTML::FormFu: '2.00' List::MoreUtils: '0' + MooseX::Attribute::Chained: v1.0.2 Storable: '0' Task::Weaken: '0' perl: '5.008001' resources: - repository: git://github.com/fireartist/HTML-FormFu-Model-DBIC.git -version: '2.00' + homepage: https://github.com/FormFu/HTML-FormFu-Model-DBIC + repository: https://github.com/FormFu/HTML-FormFu-Model-DBIC.git +version: '2.03' +x_Dist_Zilla: + perl: + version: '5.014004' + plugins: + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: runtime + type: requires + name: Prereqs + version: '6.011' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: test + type: requires + name: TestRequires + version: '6.011' + - + class: Dist::Zilla::Plugin::Prereqs + config: + Dist::Zilla::Plugin::Prereqs: + phase: develop + type: requires + name: DevelopRequires + version: '6.011' + - + class: Dist::Zilla::Plugin::Test::Perl::Critic + name: Test::Perl::Critic + version: '3.001' + - + class: Dist::Zilla::Plugin::MetaTests + name: MetaTests + version: '6.011' + - + class: Dist::Zilla::Plugin::OurPkgVersion + name: OurPkgVersion + version: '0.12' + - + class: Dist::Zilla::Plugin::PodVersion + name: PodVersion + version: '6.011' + - + class: Dist::Zilla::Plugin::Test::Kwalitee + config: + Dist::Zilla::Plugin::Test::Kwalitee: + filename: xt/release/kwalitee.t + skiptest: [] + name: Test::Kwalitee + version: '2.12' + - + class: Dist::Zilla::Plugin::Test::EOL + config: + Dist::Zilla::Plugin::Test::EOL: + filename: xt/author/eol.t + finder: + - ':InstallModules' + trailing_whitespace: 1 + name: Test::EOL + version: '0.19' + - + class: Dist::Zilla::Plugin::Test::PAUSE::Permissions + name: Test::PAUSE::Permissions + version: '0.003' + - + class: Dist::Zilla::Plugin::GithubMeta + name: GithubMeta + version: '0.54' + - + class: Dist::Zilla::Plugin::NextRelease + name: NextRelease + version: '6.011' + - + class: Dist::Zilla::Plugin::Git::GatherDir + config: + Dist::Zilla::Plugin::GatherDir: + exclude_filename: [] + exclude_match: [] + follow_symlinks: 0 + include_dotfiles: 0 + prefix: '' + prune_directory: [] + root: . + Dist::Zilla::Plugin::Git::GatherDir: + include_untracked: 0 + name: Git::GatherDir + version: '2.043' + - + class: Dist::Zilla::Plugin::Git::NextVersion + config: + Dist::Zilla::Plugin::Git::NextVersion: + first_version: '0.001' + version_by_branch: 0 + version_regexp: (?^:^v(.+)$) + Dist::Zilla::Role::Git::Repo: + git_version: 1.9.1 + repo_root: . + name: Git::NextVersion + version: '2.043' + - + class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch + config: + Dist::Zilla::Role::Git::Repo: + git_version: 1.9.1 + repo_root: . + name: Git::CheckFor::CorrectBranch + version: '0.014' + - + class: Dist::Zilla::Plugin::Git::Remote::Check + name: Git::Remote::Check + version: 0.1.2 + - + class: Dist::Zilla::Plugin::PruneCruft + name: '@Starter/PruneCruft' + version: '6.011' + - + class: Dist::Zilla::Plugin::ManifestSkip + name: '@Starter/ManifestSkip' + version: '6.011' + - + class: Dist::Zilla::Plugin::MetaConfig + name: '@Starter/MetaConfig' + version: '6.011' + - + class: Dist::Zilla::Plugin::MetaProvides::Package + config: + Dist::Zilla::Plugin::MetaProvides::Package: + finder_objects: + - + class: Dist::Zilla::Plugin::FinderCode + name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' + version: '6.011' + include_underscores: 0 + Dist::Zilla::Role::MetaProvider::Provider: + $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' + inherit_missing: '1' + inherit_version: '1' + meta_noindex: '1' + Dist::Zilla::Role::ModuleMetadata: + Module::Metadata: '1.000033' + version: '0.005' + name: '@Starter/MetaProvides::Package' + version: '2.004003' + - + class: Dist::Zilla::Plugin::MetaNoIndex + name: '@Starter/MetaNoIndex' + version: '6.011' + - + class: Dist::Zilla::Plugin::MetaYAML + name: '@Starter/MetaYAML' + version: '6.011' + - + class: Dist::Zilla::Plugin::MetaJSON + name: '@Starter/MetaJSON' + version: '6.011' + - + class: Dist::Zilla::Plugin::License + name: '@Starter/License' + version: '6.011' + - + class: Dist::Zilla::Plugin::ReadmeAnyFromPod + config: + Dist::Zilla::Role::FileWatcher: + version: '0.006' + name: '@Starter/ReadmeAnyFromPod' + version: '0.163250' + - + class: Dist::Zilla::Plugin::ExecDir + name: '@Starter/ExecDir' + version: '6.011' + - + class: Dist::Zilla::Plugin::ShareDir + name: '@Starter/ShareDir' + version: '6.011' + - + class: Dist::Zilla::Plugin::PodSyntaxTests + name: '@Starter/PodSyntaxTests' + version: '6.011' + - + class: Dist::Zilla::Plugin::Test::ReportPrereqs + name: '@Starter/Test::ReportPrereqs' + version: '0.027' + - + class: Dist::Zilla::Plugin::Test::Compile + config: + Dist::Zilla::Plugin::Test::Compile: + bail_out_on_fail: '0' + fail_on_warning: author + fake_home: 0 + filename: xt/author/00-compile.t + module_finder: + - ':InstallModules' + needs_display: 0 + phase: develop + script_finder: + - ':PerlExecFiles' + skips: [] + switch: [] + name: '@Starter/Test::Compile' + version: '2.058' + - + class: Dist::Zilla::Plugin::MakeMaker + config: + Dist::Zilla::Role::TestRunner: + default_jobs: 1 + name: '@Starter/MakeMaker' + version: '6.011' + - + class: Dist::Zilla::Plugin::Manifest + name: '@Starter/Manifest' + version: '6.011' + - + class: Dist::Zilla::Plugin::TestRelease + name: '@Starter/TestRelease' + version: '6.011' + - + class: Dist::Zilla::Plugin::RunExtraTests + config: + Dist::Zilla::Role::TestRunner: + default_jobs: 1 + name: '@Starter/RunExtraTests' + version: '0.029' + - + class: Dist::Zilla::Plugin::ConfirmRelease + name: '@Starter/ConfirmRelease' + version: '6.011' + - + class: Dist::Zilla::Plugin::UploadToCPAN + name: '@Starter/UploadToCPAN' + version: '6.011' + - + class: Dist::Zilla::Plugin::ReadmeAnyFromPod + config: + Dist::Zilla::Role::FileWatcher: + version: '0.006' + name: Pod_Readme + version: '0.163250' + - + class: Dist::Zilla::Plugin::Git::Check + config: + Dist::Zilla::Plugin::Git::Check: + untracked_files: die + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: + - Changes + - README.pod + - dist.ini + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + git_version: 1.9.1 + repo_root: . + name: '@Git/Check' + version: '2.043' + - + class: Dist::Zilla::Plugin::Git::Commit + config: + Dist::Zilla::Plugin::Git::Commit: + add_files_in: [] + commit_msg: 'v%v%t - %d%n%n%c' + Dist::Zilla::Role::Git::DirtyFiles: + allow_dirty: + - Changes + - README.pod + - dist.ini + allow_dirty_match: [] + changelog: Changes + Dist::Zilla::Role::Git::Repo: + git_version: 1.9.1 + repo_root: . + Dist::Zilla::Role::Git::StringFormatter: + time_zone: local + name: '@Git/Commit' + version: '2.043' + - + class: Dist::Zilla::Plugin::Git::Tag + config: + Dist::Zilla::Plugin::Git::Tag: + branch: ~ + changelog: Changes + signed: 0 + tag: v2.03 + tag_format: v%v%t + tag_message: 'v%v%t - %d' + Dist::Zilla::Role::Git::Repo: + git_version: 1.9.1 + repo_root: . + Dist::Zilla::Role::Git::StringFormatter: + time_zone: local + name: '@Git/Tag' + version: '2.043' + - + class: Dist::Zilla::Plugin::Git::Push + config: + Dist::Zilla::Plugin::Git::Push: + push_to: + - origin + remotes_must_exist: 1 + Dist::Zilla::Role::Git::Repo: + git_version: 1.9.1 + repo_root: . + name: '@Git/Push' + version: '2.043' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':InstallModules' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':IncModules' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':TestFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ExtraTestFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ExecFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':PerlExecFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':ShareFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':MainModule' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':AllFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: ':NoFiles' + version: '6.011' + - + class: Dist::Zilla::Plugin::FinderCode + name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' + version: '6.011' + zilla: + class: Dist::Zilla::Dist::Builder + config: + is_trial: '0' + version: '6.011' +x_serialization_backend: 'YAML::Tiny version 1.73' diff -Nru libhtml-formfu-model-dbic-perl-2.00/README libhtml-formfu-model-dbic-perl-2.03/README --- libhtml-formfu-model-dbic-perl-2.00/README 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/README 2018-04-09 21:56:30.000000000 +0000 @@ -1,15 +1,807 @@ +NAME + HTML::FormFu::Model::DBIC - Integrate HTML::FormFu with DBIx::Class -This archive contains the distribution HTML-FormFu-Model-DBIC, -version 2.00: +VERSION - Integrate HTML::FormFu with DBIx::Class + version 2.03 -This software is copyright (c) 2013 by Carl Franks. +SYNOPSIS -This is free software; you can redistribute it and/or modify it under -the same terms as the Perl 5 programming language system itself. + Example of typical use in a Catalyst controller: + sub edit : Chained { + my ( $self, $c ) = @_; + + my $form = $c->stash->{form}; + my $book = $c->stash->{book}; + + if ( $form->submitted_and_valid ) { + + # update dbic row with submitted values from form + + $form->model->update( $book ); + + $c->response->redirect( $c->uri_for('view', $book->id) ); + return; + } + elsif ( !$form->submitted ) { + + # use dbic row to set form's default values + + $form->model->default_values( $book ); + } + + return; + } -This README file was generated by Dist::Zilla::Plugin::Readme v5.015. +SETUP + + For the form object to be able to access your DBIx::Class schema, it + needs to be placed on the form stash, with the name schema. + + This is easy if you're using Catalyst-Controller-HTML-FormFu, as you + can set this up to happen in your Catalyst app's config file. + + For example, if your model is named MyApp::Model::Corp, you would set + this (in Config::General format): + + + + schema Corp + + + + Or if your app's config file is in YAML format: + + 'Controller::HTML::FormFu': + model_stash: + schema: Corp + +METHODS + + default_values + + Arguments: $dbic_row, [\%config] + + Return Value: $form + + $form->model->default_values( $dbic_row ); + + Set a form's default values from the database, to allow a user to edit + them. + + update + + Arguments: [$dbic_row], [\%config] + + Return Value: $dbic_row + + $form->model->update( $dbic_row ); + + Update the database with the submitted form values. + + create + + Arguments: [\%config] + + Return Value: $dbic_row + + my $dbic_row = $form->model->create( {resultset => 'Book'} ); + + Like "update", but doesn't require a $dbic_row argument. + + You need to ensure the DBIC schema is available on the form stash - see + "SYNOPSIS" for an example config. + + The resultset must be set either in the method arguments, or the form + or block's model_config. + + An example of setting the ResultSet name on a Form: + + --- + model_config: + resultset: FooTable + + elements: + # [snip] + + options_from_model + + Populates a multi-valued field with values from the database. + + This method should not be called directly, but is called for you during + $form->process by fields that inherit from + HTML::FormFu::Element::_Group. This includes: + + HTML::FormFu::Element::Select + + HTML::FormFu::Element::Checkboxgroup + + HTML::FormFu::Element::Radiogroup + + HTML::FormFu::Element::ComboBox + + To use you must set the appropriate resultset on the element + model_config: + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + +BUILDING FORMS + + single table + + To edit the values in a row with no related rows, the field names + simply have to correspond to the database column names. + + For the following DBIx::Class schema: + + package MySchema::Book; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("book"); + + __PACKAGE__->add_columns( + id => { data_type => "INTEGER" }, + title => { data_type => "TEXT" }, + author => { data_type => "TEXT" }, + blurb => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("id"); + + 1; + + A suitable form for this might be: + + elements: + - type: Text + name: title + + - type: Text + name: author + + - type: Textarea + name: blurb + + might_have and has_one relationships + + Set field values from a related row with a might_have or has_one + relationship by placing the fields within a Block (or any element that + inherits from Block, such as Fieldset) with its "nested_name" in + HTML::FormFu set to the relationship name. + + For the following DBIx::Class schemas: + + package MySchema::Book; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("book"); + + __PACKAGE__->add_columns( + id => { data_type => "INTEGER" }, + title => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("id"); + + __PACKAGE__->might_have( review => 'MySchema::Review', 'book' ); + + 1; + + + package MySchema::Review; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("review"); + + __PACKAGE__->add_columns( + id => { data_type => "INTEGER" }, + book => { data_type => "INTEGER", is_nullable => 1 }, + review_text => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("book"); + + __PACKAGE__->belongs_to( book => 'MySchema::Book' ); + + 1; + + A suitable form for this would be: + + elements: + - type: Text + name: title + + - type: Block + nested_name: review + elements: + - type: Textarea + name: review_text + + For might_have and has_one relationships, you generally shouldn't need + to have a field for the related table's primary key, as DBIx::Class + will handle retrieving the correct row automatically. + + You can also set a has_one or might_have relationship using a multi + value field like Select. + + elements: + - type: Text + name: title + + - type: Select + nested: review + model_config: + resultset: Review + + This will load all reviews into the select field. If you select a + review from that list, a current relationship to a review is removed + and the new one is added. This requires that the primary key of the + Review table and the foreign key do not match. + + has_many and many_to_many relationships + + The general principle is the same as for might_have and has_one above, + except you should use a Repeatable element instead of a Block, and it + needs to contain a Hidden field corresponding to the primary key of the + related table. + + The Repeatable block's nested_name must be set to the name of the + relationship. + + The Repeable block's increment_field_names must be true (which is the + default value). + + The Repeable block's counter_name must be set to the name of a Hidden + field, which is placed outside of the Repeatable block. This field is + used to store a count of the number of repetitions of the Repeatable + block were created. When the form is submitted, this value is used + during $form->process to ensure the form is rebuilt with the correct + number of repetitions. + + To allow the user to add new related rows, either empty_rows or + new_rows_max must be set - see "Config options for Repeatable blocks" + below. + + For the following DBIx::Class schemas: + + package MySchema::Book; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("book"); + + __PACKAGE__->add_columns( + id => { data_type => "INTEGER" }, + title => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("id"); + + __PACKAGE__->has_many( review => 'MySchema::Review', 'book' ); + + 1; + + + package MySchema::Review; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("review"); + + __PACKAGE__->add_columns( + book => { data_type => "INTEGER" }, + review_text => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("book"); + + __PACKAGE__->belongs_to( book => 'MySchema::Book' ); + + 1; + + A suitable form for this might be: + + elements: + - type: Text + name: title + + - type: Hidden + name: review_count + + - type: Repeatable + nested_name: review + counter_name: review_count + model_config: + empty_rows: 1 + elements: + - type: Hidden + name: book + + - type: Textarea + name: review_text + + belongs_to relationships + + Belongs-to relationships can be edited / created with a ComboBox + element. If the user selects a value with the Select field, the + belongs-to will be set to an already-existing row in the related table. + If the user enters a value into the Text field, the belongs-to will be + set using a newly-created row in the related table. + + elements: + - type: ComboBox + name: author + model_config: + resultset: Author + select_column: id + text_column: name + + The element name should match the relationship name. + $field->model_config->{select_column} should match the related primary + column. $field->model_config->{text_column} should match the related + text column. + + many_to_many selection + + To select / deselect rows from a many_to_many relationship, you must + use a multi-valued element, such as a Checkboxgroup or a Select with + multiple set. + + The field's name must be set to the name of the many_to_many + relationship. + + default_column + + If you want to search / associate the related table by a column other + it's primary key, set $field->model_config->{default_column}. + + --- + element: + - type: Checkboxgroup + name: authors + model_config: + default_column: foo + + link_values + + If you want to set columns on the link table you can do so if you add a + link_values attribute to model_config: + + --- + element: + - type: Checkboxgroup + name: authors + model_config: + link_values: + foo: bar + + additive + + The default implementation will first remove all related objects and + set the new ones (see + http://search.cpan.org/perldoc?DBIx::Class::Relationship::Base#set_$rel). + If you want to add the selected objects to the current set of objects + set additive in the model_config. + + --- + element: + - type: Checkboxgroup + name: authors + model_config: + additive: 1 + options_from_model: 0 + + "options_from_model" is set to 0 because it will try to fetch all + objects from the result class Authors if model_config is specified + without a resultset attribute.) + +COMMON ARGUMENTS + + The following items are supported in the optional config hash-ref + argument to the methods default_values, update and create. + + base + + If you want the method to process a particular Block element, rather + than the whole form, you can pass the element as a base argument. + + $form->default_values( + $row, + { + base => $formfu_element, + }, + ); + + nested_base + + If you want the method to process a particular Block element by name, + you can pass the name as an argument. + + $form->default_values( + $row, + { + nested_base => 'foo', + }' + ); + +CONFIGURATION + + Config options for fields + + The following items are supported as model_config options on form + fields. + + accessor + + If set, accessor will be used as a method-name accessor on the + DBIx::Class row object, instead of using the field name. + + ignore_if_empty + + If the submitted value is blank, no attempt will be made to save it + to the database. + + null_if_empty + + If the submitted value is blank, save it as NULL to the database. + Normally an empty string is saved as NULL when its corresponding + field is numeric, and as an empty string when its corresponding field + is a text field. This option is useful for changing the default + behavior for text fields. + + delete_if_empty + + Useful for editing a "might_have" related row containing only one + field. + + If the submitted value is blank, the related row is deleted. + + For the following DBIx::Class schemas: + + package MySchema::Book; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("book"); + + __PACKAGE__->add_columns( + id => { data_type => "INTEGER" }, + title => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("id"); + + __PACKAGE__->might_have( review => 'MySchema::Review', 'book' ); + + 1; + + + package MySchema::Review; + use base 'DBIx::Class'; + + __PACKAGE__->load_components(qw/ Core /); + + __PACKAGE__->table("review"); + + __PACKAGE__->add_columns( + book => { data_type => "INTEGER" }, + review_text => { data_type => "TEXT" }, + ); + + __PACKAGE__->set_primary_key("book"); + + __PACKAGE__->belongs_to( book => 'MySchema::Book' ); + + 1; + + A suitable form for this would be: + + elements: + - type: Text + name: title + + - type: Block + nested_name: review + elements: + - type: Text + name: review_text + model_config: + delete_if_empty: 1 + + label + + To use a column value for a form field's label. + + Config options for fields within a Repeatable block + + delete_if_true + + Intended for use on a Checkbox field. + + If the checkbox is checked, the following occurs: for a has-many + relationship, the related row is deleted; for a many-to-many + relationship, the relationship link is removed. + + An example of use might be: + + elements: + - type: Text + name: title + + - type: Hidden + name: review_count + + - type: Repeatable + nested_name: review + counter_name: review_count + elements: + - type: Hidden + name: book + + - type: Textarea + name: review_text + + - type: Checkbox + name: delete_review + label: 'Delete Review?' + model_config: + delete_if_true: 1 + + Note: make sure the name of this field does not clash with one of + your DBIx::Class::Row method names (e.g. "delete") - see "CAVEATS". + + Config options for Repeatable blocks + + empty_rows + + For a Repeatable block corresponding to a has-many or many-to-many + relationship, to allow the user to insert new rows, set empty_rows to + the number of extra repetitions you wish added to the end of the + Repeatable block. + + new_rows_max + + Set to the maximum number of new rows that a Repeatable block is + allowed to add. + + If not set, it will fallback to the value of empty_rows. + + Config options for options_from_model + + The column used for the element values is set with the model_config + value id_column - or if not set, the table's primary column is used. + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + id_column: pk_col + + The column used for the element labels is set with the model_config + value label_column - or if not set, the first text/varchar column found + in the table is used - or if one is not found, the id_column is used + instead. + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + label_column: label_col + + To pass the database label values via the form's localization object, + set localize_label + + element: + - type: Select + name: foo + model_config: + localize_label: 1 + + You can set a condition, which will be passed as the 1st argument to + "search" in DBIx::Class::ResultSet. + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + condition: + type: is_foo + + You can set a condition_from_stash, which will be passed as the 1st + argument to "search" in DBIx::Class::ResultSet. + + key is the column-name to be passed to search, and stash_key is the + name of a key on the form stash from which the value to be passed to + search is found. + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + condition_from_stash: + key: stash_key + + Is comparable to: + + $form->element({ + type => 'Select', + name => 'foo', + model_config => { + resultset => 'TableClass', + condition => { + key => $form->stash->{stash_key} + } + } + }) + + If the value in the stash is nested in a data-structure, you can access + it by setting expand_stash_dots. As you can see in the example below, + it automatically handles calling methods on objects, accessing + hash-keys on hash-references, and accessing array-slots on array + references. + + element: + - type: Select + name: foo + model_config: + resultset: TableClass + condition_from_stash: + key: foo.bar.0 + expand_stash_dots: 1 + + Is comparable to: + + $form->element({ + type => 'Select', + name => 'foo', + model_config => { + resultset => 'TableClass', + condition => { + key => $form->stash->{foo}->bar->[0]; + } + } + }) + # Where stash returns a hashref. + # The 'foo' hash-key returns an object. + # The object-method 'bar' returns an arrayref. + # The first array slot returns the value used in the query. + + You can set attributes, which will be passed as the 2nd argument to + "search" in DBIx::Class::ResultSet. + + ENUM Column Type + + If the field name matches (case-insensitive) a column name with type + 'ENUM' and the Schema contains enum values in + $resultset->column_info($name)->{extra}{list}, the field's options will + be populated with the enum values. + +FAQ + + Add extra values not in the form + + To update values to the database which weren't submitted to the form, + you can first add them to the form with add_valid. + + my $passwd = generate_passwd(); + + $form->add_valid( passwd => $passwd ); + + $form->model->update( $row ); + + add_valid works for fieldnames that don't exist in the form. + + Set a field read only + + You can make a field read only. The value of such fields cannot be + changed by the user even if they submit a value for it. + + $field->model_config->{read_only} = 1; + + - Name: field + model_config: + read_only: 1 + + See HTML::FormFu::Element::Label. + +CAVEATS + + To ensure your column's inflators and deflators are called, we have to + get / set values using their named methods, and not with get_column / + set_column. + + Because of this, beware of having column names which clash with + DBIx::Class built-in method-names, such as delete. - It will have + obviously undesirable results! + +REMOVED METHODS + + new_empty_row + + See empty_rows in "Config options for Repeatable blocks" instead. + + new_empty_row_multi + + See new_rows_max in "Config options for Repeatable blocks" instead. + + Range constraint + + See empty_rows in "Config options for Repeatable blocks" instead. + +SUPPORT + + Project Page: + + http://code.google.com/p/html-formfu/ + + Mailing list: + + http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu + + Mailing list archives: + + http://lists.scsys.co.uk/pipermail/html-formfu/ + +BUGS + + Please submit bugs / feature requests to + http://code.google.com/p/html-formfu/issues/list (preferred) or + http://rt.perl.org. + +GITHUB REPOSITORY + + This module's sourcecode is maintained in a git repository at + git://github.com/fireartist/HTML-FormFu-Model-DBIC.git + + The project page is + https://github.com/fireartist/HTML-FormFu-Model-DBIC + +SEE ALSO + + HTML::FormFu, DBIx::Class, Catalyst::Controller::HTML::FormFu + +AUTHOR + + Carl Franks + +CONTRIBUTORS + + Based on the code of DBIx::Class::HTML::FormFu, which was contributed + to by: + + Adam Herzog + + Daisuke Maki + + Mario Minati + +COPYRIGHT AND LICENSE + + Copyright (C) 2007 by Carl Franks + + Based on the original source code of DBIx::Class::HTMLWidget, copyright + Thomas Klausner. + + This library is free software; you can redistribute it and/or modify it + under the same terms as Perl itself, either Perl version 5.8.8 or, at + your option, any later version of Perl 5 you may have available. diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/00-report-prereqs.dd libhtml-formfu-model-dbic-perl-2.03/t/00-report-prereqs.dd --- libhtml-formfu-model-dbic-perl-2.00/t/00-report-prereqs.dd 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/00-report-prereqs.dd 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,48 @@ +do { my $x = { + 'configure' => { + 'requires' => { + 'ExtUtils::MakeMaker' => '0' + } + }, + 'develop' => { + 'requires' => { + 'File::Spec' => '0', + 'IO::Handle' => '0', + 'IPC::Open3' => '0', + 'Test::CPAN::Meta' => '0', + 'Test::EOL' => '0', + 'Test::Kwalitee' => '1.21', + 'Test::More' => '0.88', + 'Test::PAUSE::Permissions' => '0', + 'Test::Perl::Critic' => '0', + 'Test::Pod' => '1.41' + } + }, + 'runtime' => { + 'requires' => { + 'DBD::SQLite' => '0', + 'DBIx::Class' => '0.08108', + 'HTML::FormFu' => '2.00', + 'List::MoreUtils' => '0', + 'MooseX::Attribute::Chained' => 'v1.0.2', + 'Storable' => '0', + 'Task::Weaken' => '0', + 'perl' => '5.008001' + } + }, + 'test' => { + 'recommends' => { + 'CPAN::Meta' => '2.120900' + }, + 'requires' => { + 'DateTime::Format::SQLite' => '0', + 'ExtUtils::MakeMaker' => '0', + 'File::Spec' => '0', + 'Locale::Maketext' => '0', + 'SQL::Translator' => '0.11016', + 'Test::More' => '0.99' + } + } + }; + $x; + } \ No newline at end of file diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/00-report-prereqs.t libhtml-formfu-model-dbic-perl-2.03/t/00-report-prereqs.t --- libhtml-formfu-model-dbic-perl-2.00/t/00-report-prereqs.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/00-report-prereqs.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,193 @@ +#!perl + +use strict; +use warnings; + +# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 + +use Test::More tests => 1; + +use ExtUtils::MakeMaker; +use File::Spec; + +# from $version::LAX +my $lax_version_re = + qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? + | + (?:\.[0-9]+) (?:_[0-9]+)? + ) | (?: + v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? + | + (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? + ) + )/x; + +# hide optional CPAN::Meta modules from prereq scanner +# and check if they are available +my $cpan_meta = "CPAN::Meta"; +my $cpan_meta_pre = "CPAN::Meta::Prereqs"; +my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic + +# Verify requirements? +my $DO_VERIFY_PREREQS = 1; + +sub _max { + my $max = shift; + $max = ( $_ > $max ) ? $_ : $max for @_; + return $max; +} + +sub _merge_prereqs { + my ($collector, $prereqs) = @_; + + # CPAN::Meta::Prereqs object + if (ref $collector eq $cpan_meta_pre) { + return $collector->with_merged_prereqs( + CPAN::Meta::Prereqs->new( $prereqs ) + ); + } + + # Raw hashrefs + for my $phase ( keys %$prereqs ) { + for my $type ( keys %{ $prereqs->{$phase} } ) { + for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { + $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; + } + } + } + + return $collector; +} + +my @include = qw( + +); + +my @exclude = qw( + +); + +# Add static prereqs to the included modules list +my $static_prereqs = do './t/00-report-prereqs.dd'; + +# Merge all prereqs (either with ::Prereqs or a hashref) +my $full_prereqs = _merge_prereqs( + ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), + $static_prereqs +); + +# Add dynamic prereqs to the included modules list (if we can) +my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; +my $cpan_meta_error; +if ( $source && $HAS_CPAN_META + && (my $meta = eval { CPAN::Meta->load_file($source) } ) +) { + $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); +} +else { + $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) + $source = 'static metadata'; +} + +my @full_reports; +my @dep_errors; +my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; + +# Add static includes into a fake section +for my $mod (@include) { + $req_hash->{other}{modules}{$mod} = 0; +} + +for my $phase ( qw(configure build test runtime develop other) ) { + next unless $req_hash->{$phase}; + next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); + + for my $type ( qw(requires recommends suggests conflicts modules) ) { + next unless $req_hash->{$phase}{$type}; + + my $title = ucfirst($phase).' '.ucfirst($type); + my @reports = [qw/Module Want Have/]; + + for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { + next if $mod eq 'perl'; + next if grep { $_ eq $mod } @exclude; + + my $file = $mod; + $file =~ s{::}{/}g; + $file .= ".pm"; + my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; + + my $want = $req_hash->{$phase}{$type}{$mod}; + $want = "undef" unless defined $want; + $want = "any" if !$want && $want == 0; + + my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; + + if ($prefix) { + my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); + $have = "undef" unless defined $have; + push @reports, [$mod, $want, $have]; + + if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { + if ( $have !~ /\A$lax_version_re\z/ ) { + push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; + } + elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { + push @dep_errors, "$mod version '$have' is not in required range '$want'"; + } + } + } + else { + push @reports, [$mod, $want, "missing"]; + + if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { + push @dep_errors, "$mod is not installed ($req_string)"; + } + } + } + + if ( @reports ) { + push @full_reports, "=== $title ===\n\n"; + + my $ml = _max( map { length $_->[0] } @reports ); + my $wl = _max( map { length $_->[1] } @reports ); + my $hl = _max( map { length $_->[2] } @reports ); + + if ($type eq 'modules') { + splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; + push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; + } + else { + splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; + push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; + } + + push @full_reports, "\n"; + } + } +} + +if ( @full_reports ) { + diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; +} + +if ( $cpan_meta_error || @dep_errors ) { + diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; +} + +if ( $cpan_meta_error ) { + my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; + diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; +} + +if ( @dep_errors ) { + diag join("\n", + "\nThe following REQUIRED prerequisites were not satisfied:\n", + @dep_errors, + "\n" + ); +} + +pass; + +# vim: ts=4 sts=4 sw=4 et: diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_column.yml libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_column.yml --- libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_column.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_column.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,7 +4,7 @@ elements: - type: Hidden name: id - + - type: Text name: username constraints: @@ -12,10 +12,10 @@ - type: DBIC::Unique resultset: User column: name - + - type: Text name: title - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_method.yml libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_method.yml --- libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_method.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_method.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,7 +4,7 @@ elements: - type: Hidden name: id - + - type: Text name: name constraints: @@ -13,10 +13,10 @@ resultset: User method_name: is_name_available self_stash_key: user - + - type: Text name: title - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_others.yml libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_others.yml --- libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_others.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_others.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,7 +4,7 @@ elements: - type: Hidden name: id - + - type: Text name: name constraints: @@ -12,10 +12,10 @@ - type: DBIC::Unique resultset: User others: title - + - type: Text name: title - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_repeatable_id_field.yml libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_repeatable_id_field.yml --- libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique_repeatable_id_field.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique_repeatable_id_field.yml 2018-04-09 21:56:30.000000000 +0000 @@ -13,13 +13,13 @@ elements: - type: Hidden name: id - + - name: name constraints: - type: DBIC::Unique resultset: User id_field: user.id - + - name: title - type: Submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique.t libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique.t --- libhtml-formfu-model-dbic-perl-2.00/t/constraints/dbic_unique.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/constraints/dbic_unique.t 2018-04-09 21:56:30.000000000 +0000 @@ -26,16 +26,16 @@ # Basic form. { my $form = HTML::FormFu->new; - + $form->load_config_file('t/constraints/dbic_unique.yml'); - + $form->stash->{'schema'} = $schema; $form->process( { 'name' => 'a', 'title' => 'c', } ); - + ok( !$form->submitted_and_valid ); is_deeply( @@ -49,16 +49,16 @@ # Form where DB column differs from form field name. { my $form = HTML::FormFu->new; - + $form->load_config_file('t/constraints/dbic_unique_column.yml'); - + $form->stash->{'schema'} = $schema; $form->process( { 'username' => 'a', 'title' => 'c', } ); - + ok( !$form->submitted_and_valid ); is_deeply( @@ -72,23 +72,23 @@ # Form tracking a multi-column unique key (name+title). { my $form = HTML::FormFu->new; - + $form->load_config_file('t/constraints/dbic_unique_others.yml'); - + $form->stash->{'schema'} = $schema; $form->process( { 'name' => 'a', 'title' => 'c', } ); - + ok( $form->submitted_and_valid ); $form->process( { 'name' => 'a', 'title' => 'b', } ); - + ok( !$form->submitted_and_valid ); is_deeply( @@ -102,11 +102,11 @@ # Form using a method_name to determine uniqueness with record on stash (is_name_available). { my $form = HTML::FormFu->new; - + $form->load_config_file('t/constraints/dbic_unique_method.yml'); - + my $user = $schema->resultset('User')->find( {name => 'a'} ); - + $form->stash->{'schema'} = $schema; $form->stash->{'user'} = $user; @@ -114,14 +114,14 @@ 'name' => 'a', 'title' => 'b', } ); - + ok( $form->submitted_and_valid ); $form->process( { 'name' => 'c', 'title' => 'd', } ); - + ok( $form->submitted_and_valid ); $form->process( { diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/create/basic.yml libhtml-formfu-model-dbic-perl-2.03/t/create/basic.yml --- libhtml-formfu-model-dbic-perl-2.00/t/create/basic.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/create/basic.yml 2018-04-09 21:56:30.000000000 +0000 @@ -6,41 +6,41 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Password name: password_col - + - type: Checkbox name: checkbox_col value: foo - + - type: Select name: select_col options: - [1, one] - [2, two] - [3, three] - + - type: Radio name: radio_col value: yes - + - type: Radio name: radio_col value: no - + - type: Radiogroup name: radiogroup_col values: [1, 2, 3] - + - type: Text name: date_col - + - type: Text name: unknown_col - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/basic_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/basic_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/basic_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/basic_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,41 +5,41 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Password name: password_col - + - type: Checkbox name: checkbox_col value: foo - + - type: Select name: select_col options: - [1, one] - [2, two] - [3, three] - + - type: Radio name: radio_col value: yes - + - type: Radio name: radio_col value: no - + - type: Radiogroup name: radiogroup_col values: [1, 2, 3] - + - type: Text name: date_col - + - type: Text name: unknown_col - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/basic.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/basic.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/basic.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/basic.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,32 +4,32 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Password name: password_col - + - type: Checkbox name: checkbox_col value: foo - + - type: Select name: select_col options: - [1, one] - [2, two] - [3, three] - + - type: Radio name: radio_col value: yes - + - type: Radio name: radio_col value: no - + - type: Radiogroup name: radiogroup_col values: [1, 2, 3] @@ -40,12 +40,12 @@ - [one] - [two] - [three] - + - type: Date name: date_col - + - type: Text name: unknown_col - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/belongs_to_lookup_table_combobox.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/belongs_to_lookup_table_combobox.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/belongs_to_lookup_table_combobox.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/belongs_to_lookup_table_combobox.t 2018-04-09 21:56:30.000000000 +0000 @@ -19,7 +19,7 @@ { my $type_rs = $schema->resultset('Type'); - + # types $type_rs->delete; $type_rs->create( { type => 'type 1' } ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/belongs_to_lookup_table_combobox.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/belongs_to_lookup_table_combobox.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/belongs_to_lookup_table_combobox.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/belongs_to_lookup_table_combobox.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,10 +4,10 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: ComboBox name: type # set this, so options_from_model() populates the menu, @@ -19,6 +19,6 @@ - type: ComboBox name: type2_id - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/belongs_to_lookup_table.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/belongs_to_lookup_table.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/belongs_to_lookup_table.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/belongs_to_lookup_table.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Select name: type_id - type: Select name: type2_id - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/empty_rows_zero.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/empty_rows_zero.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/empty_rows_zero.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/empty_rows_zero.t 2018-04-09 21:56:30.000000000 +0000 @@ -36,7 +36,7 @@ is( $form->get_field('id')->default, '4' ); is( $form->get_field('count')->default, '0' ); - + my $block = $form->get_all_element( { nested_name => 'addresses' } ); my @reps = @{ $block->get_elements }; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/empty_rows_zero.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/empty_rows_zero.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/empty_rows_zero.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/empty_rows_zero.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,22 +4,22 @@ elements: - type: Hidden name: id - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 0 - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_combobox.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_combobox.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_combobox.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_combobox.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: ComboBox name: addresses - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_delete_true.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_delete_true.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_delete_true.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_delete_true.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,30 +4,30 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 2 - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Checkbox name: delete model_config: delete_if_true: 1 - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_label.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_label.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_label.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_label.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,25 +4,25 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: address model_config: label: my_label - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,23 +5,23 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_new.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_new.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_new.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_new.t 2018-04-09 21:56:30.000000000 +0000 @@ -53,7 +53,7 @@ is( $reps[2]->get_field('id')->default, undef ); is( $reps[2]->get_field('address')->default, undef ); - + is( $reps[3]->get_field('id')->default, undef ); is( $reps[3]->get_field('address')->default, undef ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_new.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_new.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable_new.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable_new.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,25 +4,25 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 2 - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_repeatable.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_repeatable.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,23 +4,23 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_select.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_many_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_many_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: addresses - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_one_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_one_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_one_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_one_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,15 +5,15 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: user elements: - type: Text name: name - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_one.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_one.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/has_one.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/has_one.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: user elements: - type: Text name: name - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/label.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/label.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/label.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/label.t 2018-04-09 21:56:30.000000000 +0000 @@ -34,7 +34,7 @@ my $fs = $form->get_element; my $name = $fs->get_field('name')->render_data; - + is( $name->{value}, 'billy bob' ); is( $name->{label}, 'mr' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/label.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/label.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/label.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/label.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,11 +4,11 @@ elements: - type: Hidden name: id - + - type: Text name: name model_config: label: title - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_checkboxgroup.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_checkboxgroup.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_checkboxgroup.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_checkboxgroup.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,12 +4,12 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Checkboxgroup name: bands - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many-has_many.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many-has_many.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many-has_many.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many-has_many.t 2018-04-09 21:56:30.000000000 +0000 @@ -38,15 +38,15 @@ { # band 2 my $band = $schema->resultset('Band')->create({ band => 'band 2' }); - + # user 5,6 my $user1 = $band->add_to_users({ name => 'user 5', master => $master->id }); my $user2 = $band->add_to_users({ name => 'user 6', master => $master->id }); - + # address 2,3 $user1->create_related( 'addresses', { address => 'add 2' } ); $user1->create_related( 'addresses', { address => 'add 3' } ); - + # address 4 $user2->create_related( 'addresses', { address => 'add 4' } ); } @@ -70,40 +70,40 @@ is( $users[0]->nested_name, 'users_1' ); is( $users[0]->get_field('id')->default, '5' ); is( $users[0]->get_field('name')->default, 'user 5' ); - + is( $users[0]->get_field('count')->default, '2' ); - + my $addresses_repeatable = $users[0]->get_all_element({ nested_name => 'addresses' }); - + my @addresses = @{ $addresses_repeatable->get_elements }; - + is( scalar @addresses, 2 ); - + # address 2 is( $addresses[0]->nested_name, 'addresses_1' ); is( $addresses[0]->get_field('id')->default, '2' ); is( $addresses[0]->get_field('address')->default, 'add 2' ); - + # address 3 is( $addresses[1]->nested_name, 'addresses_2' ); is( $addresses[1]->get_field('id')->default, '3' ); is( $addresses[1]->get_field('address')->default, 'add 3' ); } - + # user 6 { is( $users[1]->nested_name, 'users_2' ); is( $users[1]->get_field('id')->default, '6' ); is( $users[1]->get_field('name')->default, 'user 6' ); - + is( $users[1]->get_field('count')->default, '1' ); - + my $addresses_repeatable = $users[1]->get_all_element({ nested_name => 'addresses' }); - + my @addresses = @{ $addresses_repeatable->get_elements }; - + is( scalar @addresses, 1 ); - + # address 4 is( $addresses[0]->nested_name, 'addresses_1' ); is( $addresses[0]->get_field('id')->default, '4' ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many-has_many.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many-has_many.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many-has_many.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many-has_many.yml 2018-04-09 21:56:30.000000000 +0000 @@ -3,32 +3,32 @@ elements: - name: band - + - type: Hidden name: count - + - type: Repeatable nested_name: users counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: name - + - type: Hidden name: count - + - type: Repeatable nested_name: addresses counter_name: count elements: - type: Hidden name: id - + - name: address - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_repeatable_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_repeatable_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_repeatable_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_repeatable_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,23 +5,23 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: bands counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: band - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_repeatable_new.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_repeatable_new.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_repeatable_new.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_repeatable_new.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,25 +4,25 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: bands counter_name: count model_config: empty_rows: 1 - + elements: - type: Hidden name: id - + - type: Text name: band - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_repeatable.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_repeatable.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_repeatable.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_repeatable.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,23 +4,23 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: bands counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: band - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_select_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_select_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_select_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_select_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,13 +5,13 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: bands multiple: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_select.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/many_to_many_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/many_to_many_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,13 +4,13 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: bands multiple: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/methods.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/methods.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/methods.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/methods.t 2018-04-09 21:56:30.000000000 +0000 @@ -27,6 +27,6 @@ my $field = $form->get_element('method_test'); is( $field->render_data->{value}, "filler" ); - + } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/might_have.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/might_have.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/might_have.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/might_have.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,18 +4,18 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: note elements: - type: Hidden name: id - + - type: Textarea name: note - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/multi_label.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/multi_label.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/multi_label.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/multi_label.t 2018-04-09 21:56:30.000000000 +0000 @@ -36,7 +36,7 @@ is( $multi->render_data->{label}, 'mr' ); my $name = $multi->get_field('name')->render_data; - + is( $name->{value}, 'billy bob' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/multi_label.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/multi_label.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/multi_label.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/multi_label.yml 2018-04-09 21:56:30.000000000 +0000 @@ -3,14 +3,14 @@ - type: Multi model_config: label: title - + elements: - + - type: Hidden name: id - + - type: Text name: name - + - type : Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/nested_name_accessor.t libhtml-formfu-model-dbic-perl-2.03/t/default_values/nested_name_accessor.t --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/nested_name_accessor.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/nested_name_accessor.t 2018-04-09 21:56:30.000000000 +0000 @@ -34,7 +34,7 @@ $form->model->default_values($row); is( $form->get_field('name')->default, 'mr. foo' ); - + is ( $form->get_field('value')->default, 'b' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/nested_name_accessor.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/nested_name_accessor.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/nested_name_accessor.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/nested_name_accessor.yml 2018-04-09 21:56:30.000000000 +0000 @@ -1,9 +1,9 @@ --- elements: - name: name - + - type: Block nested_name: foo - + elements: - name: value diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/opt_accessor_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/opt_accessor_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/opt_accessor_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/opt_accessor_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,11 +5,11 @@ elements: - type: Hidden name: id - + - type: Text name: fullname model_config: accessor: fullname - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/default_values/opt_accessor.yml libhtml-formfu-model-dbic-perl-2.03/t/default_values/opt_accessor.yml --- libhtml-formfu-model-dbic-perl-2.00/t/default_values/opt_accessor.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/default_values/opt_accessor.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,11 +4,11 @@ elements: - type: Hidden name: id - + - type: Text name: fullname model_config: accessor: fullname - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/lib/DBICTestLib.pm libhtml-formfu-model-dbic-perl-2.03/t/lib/DBICTestLib.pm --- libhtml-formfu-model-dbic-perl-2.00/t/lib/DBICTestLib.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/lib/DBICTestLib.pm 2018-04-09 21:56:30.000000000 +0000 @@ -10,15 +10,15 @@ sub new_schema { my $schema = MySchema->connect('dbi:SQLite:dbname=:memory:'); - + $schema->deploy; - + $schema->resultset('Type')->create({ id => 1, type => 'foo' }); $schema->resultset('Type')->create({ id => 2, type => 'bar' }); - + $schema->resultset('Type2')->create({ id => 1, type => 'foo' }); $schema->resultset('Type2')->create({ id => 2, type => 'bar' }); - + return $schema; } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/lib/HTMLFormFu/I18N.pm libhtml-formfu-model-dbic-perl-2.03/t/lib/HTMLFormFu/I18N.pm --- libhtml-formfu-model-dbic-perl-2.00/t/lib/HTMLFormFu/I18N.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/lib/HTMLFormFu/I18N.pm 2018-04-09 21:56:30.000000000 +0000 @@ -8,7 +8,7 @@ sub localize { my $self = shift; - + return $self->maketext(@_); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/lib/HTMLFormFu/MockContext.pm libhtml-formfu-model-dbic-perl-2.03/t/lib/HTMLFormFu/MockContext.pm --- libhtml-formfu-model-dbic-perl-2.00/t/lib/HTMLFormFu/MockContext.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/lib/HTMLFormFu/MockContext.pm 2018-04-09 21:56:30.000000000 +0000 @@ -4,13 +4,13 @@ sub new { my ( $class, $args ) = @_; - + return bless $args, $class; } sub model { my ( $self ) = @_; - + return $self->{model} } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/lib/MySchema/Master.pm libhtml-formfu-model-dbic-perl-2.03/t/lib/MySchema/Master.pm --- libhtml-formfu-model-dbic-perl-2.00/t/lib/MySchema/Master.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/lib/MySchema/Master.pm 2018-04-09 21:56:30.000000000 +0000 @@ -4,7 +4,7 @@ use base 'DBIx::Class'; -__PACKAGE__->load_components(qw/ +__PACKAGE__->load_components(qw/ InflateColumn::DateTime Core /); @@ -82,12 +82,12 @@ } sub inflate_column_list_comma { - sub { + sub { [split(/,/, shift )]; } } sub deflate_column_list_comma { - sub { + sub { join(',', @{(shift)} ); } } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/lib/MySchema/User.pm libhtml-formfu-model-dbic-perl-2.03/t/lib/MySchema/User.pm --- libhtml-formfu-model-dbic-perl-2.00/t/lib/MySchema/User.pm 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/lib/MySchema/User.pm 2018-04-09 21:56:30.000000000 +0000 @@ -34,35 +34,35 @@ if (@_) { my $fullname = shift; - + my $match = qr/ (?: ( \w+ ) \s+ )? ( .* ) /x; - + my ($title, $name) = $fullname =~ $match; - + $self->set_column( 'title', $title ); $self->set_column( 'name', $name ); - + return $fullname; } - + my $title = $self->get_column('title'); my $name = $self->get_column('name'); - + return join ' ', grep {defined} $title, $name; } sub foo { my ($self) = @_; - + my $row = $self->find_or_new_related( 'hasmanys', { key => 'foo' } ); - + if ( @_ > 1 ) { $row->update(@_); } - + return $row; } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_combobox.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_combobox.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_combobox.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_combobox.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,19 +4,19 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: ComboBox name: type model_config: aaa : aaa - + - type: ComboBox name: type2_id model_config: resultset: Type2 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero_combobox.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero_combobox.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero_combobox.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero_combobox.t 2018-04-09 21:56:30.000000000 +0000 @@ -37,6 +37,6 @@ { my $option = $form->get_field('type')->options; - + is( scalar @$option, 0 ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero_combobox.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero_combobox.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero_combobox.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero_combobox.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,14 +4,14 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: ComboBox name: type model_config: options_from_model: 0 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero.t 2018-04-09 21:56:30.000000000 +0000 @@ -37,6 +37,6 @@ { my $option = $form->get_field('type')->options; - + is( scalar @$option, 0 ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_config_zero.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_config_zero.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,14 +4,14 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Select name: type model_config: options_from_model: 0 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_localize_label.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_localize_label.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_localize_label.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_localize_label.t 2018-04-09 21:56:30.000000000 +0000 @@ -28,9 +28,9 @@ { my $option = $form->get_field('type')->options; - + ok( @$option == 2 ); - + is( $option->[0]->{label}, 'Foo' ); is( $option->[1]->{label}, 'Bar' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_localize_label.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_localize_label.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to_localize_label.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to_localize_label.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,11 +5,11 @@ elements: - type: Hidden name: id - + - type: Select name: type model_config: localize_label: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to.t 2018-04-09 21:56:30.000000000 +0000 @@ -35,9 +35,9 @@ { my $option = $form->get_field('type')->options; - + ok( @$option == 3 ); - + is( $option->[0]->{label}, 'type 1' ); is( $option->[1]->{label}, 'type 2' ); is( $option->[2]->{label}, 'type 3' ); @@ -45,9 +45,9 @@ { my $option = $form->get_field('type2_id')->options; - + ok( @$option == 3 ); - + is( $option->[0]->{label}, 'type 1' ); is( $option->[1]->{label}, 'type 2' ); is( $option->[2]->{label}, 'type 3' ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/belongs_to.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/belongs_to.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,19 +4,19 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Select name: type model_config: aaa : aaa - + - type: Select name: type2_id model_config: resultset: Type2 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/condition_from_stash_expand.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/condition_from_stash_expand.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/condition_from_stash_expand.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/condition_from_stash_expand.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,52 @@ +use strict; +use warnings; +use Test::More tests => 4; + +use HTML::FormFu; +use lib 't/lib'; +use DBICTestLib 'new_schema'; +use MySchema; +my $form = HTML::FormFu->new; + +$form->load_config_file('t/options_from_model/condition_from_stash.yml'); + +my $schema = new_schema(); + +$form->stash->{schema} = $schema; + +my $master_rs = $schema->resultset('Master'); +my $user_rs = $schema->resultset('User'); + +{ + my $m1 = $master_rs->create({ text_col => 'foo' }); + + $m1->create_related( 'user', { name => 'a' } ); + $m1->create_related( 'user', { name => 'b' } ); + $m1->create_related( 'user', { name => 'c' } ); +} + +{ + my $m2 = $master_rs->create({ text_col => 'bar' }); + + $m2->create_related( 'user', { name => 'd' } ); + $m2->create_related( 'user', { name => 'e' } ); + $m2->create_related( 'user', { name => 'f' } ); + $m2->create_related( 'user', { name => 'g' } ); + + $form->stash->{foo}{bar}[0] = $m2->id; +} + +$form->stash->{schema} = $schema; +$form->stash->{master_id} = {'!=' => '2' }; +$form->process; + +{ + my $option = $form->get_field('user')->options; + + ok( @$option == 3 ); + + is( $option->[0]->{label}, 'a' ); + is( $option->[1]->{label}, 'b' ); + is( $option->[2]->{label}, 'c' ); +} + diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/condition_from_stash_expand.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/condition_from_stash_expand.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/condition_from_stash_expand.yml 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/condition_from_stash_expand.yml 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,11 @@ +--- +auto_fieldset: 1 + +elements: + - type: Select + name: user + model_config: + resultset: User + condition_from_stash: + master: foo.bar.0 + expand_stash_dots: 1 diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/constraint_autoset.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/constraint_autoset.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/constraint_autoset.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/constraint_autoset.t 2018-04-09 21:56:30.000000000 +0000 @@ -38,9 +38,9 @@ { my $option = $form->get_field('type')->options; - + ok( @$option == 3 ); - + is( $option->[0]->{label}, 'type 1' ); is( $option->[1]->{label}, 'type 2' ); is( $option->[2]->{label}, 'type 3' ); @@ -48,9 +48,9 @@ { my $option = $form->get_field('type2_id')->options; - + ok( @$option == 3 ); - + is( $option->[0]->{label}, 'type 1' ); is( $option->[1]->{label}, 'type 2' ); is( $option->[2]->{label}, 'type 3' ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/constraint_autoset.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/constraint_autoset.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/constraint_autoset.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/constraint_autoset.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,23 +4,23 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Select name: type model_config: options_from_model: 1 constraint: - AutoSet - + - type: Select name: type2_id model_config: resultset: Type2 constraint: - AutoSet - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/enum_select.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/enum_select.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/enum_select.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/enum_select.t 2018-04-09 21:56:30.000000000 +0000 @@ -20,9 +20,9 @@ { my $option = $form->get_field('enum_col')->options; - + is( scalar( @$option ), 3 ); - + is( $option->[0]->{label}, 'a' ); is( $option->[1]->{label}, 'b' ); is( $option->[2]->{label}, 'c' ); @@ -34,7 +34,7 @@ $form->process({ enum_col => 'a', }); - + ok( $form->valid('enum_col') ); } @@ -42,6 +42,6 @@ $form->process({ enum_col => 'd', }); - + ok( ! $form->valid('enum_col') ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/enum_select.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/enum_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/enum_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/enum_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,10 +4,10 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Select name: enum_col model_config: @@ -15,6 +15,6 @@ resultset: Master constraint: - AutoSet - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/has_many_repeatable_select.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/has_many_repeatable_select.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/has_many_repeatable_select.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/has_many_repeatable_select.t 2018-04-09 21:56:30.000000000 +0000 @@ -28,49 +28,49 @@ { # manager 1 my $manager = $schema->resultset('Manager')->create({ name => 'manager 1' }); - + # band 1, 2 my $band1 = $manager->create_related( 'bands', { band => 'band 1' } ); my $band2 = $manager->create_related( 'bands', { band => 'band 2' } ); - + # user 3, 4 $band1->add_to_users({ name => 'user 3', master => $manager->id }); $band1->add_to_users({ name => 'user 4', master => $manager->id }); - + # user 5 $band2->add_to_users({ name => 'user 5', master => $manager->id }); } { $form->process; - + my $manager = $schema->resultset('Manager')->find(1); - + $form->model->default_values( $manager ); - + is( $form->get_field('id')->default, '1' ); is( $form->get_field('name')->default, 'manager 1' ); is( $form->get_field('count')->default, '2' ); - + my $bands_repeatable = $form->get_all_element({ nested_name => 'bands' }); - + my @bands = @{ $bands_repeatable->get_elements }; - + is( scalar @bands, 2 ); - + # band 1 { is( $bands[0]->nested_name, 'bands_1' ); is( $bands[0]->get_field('id')->default, '1' ); is( $bands[0]->get_field('band')->default, 'band 1' ); - + # user 3 my $select = $bands[0]->get_field('users'); - + is_deeply( $select->default, [3, 4] ); - + is( scalar @{ $select->options }, 5 ); - + is( $select->options->[0]->{value}, '1' ); is( $select->options->[0]->{label}, 'user 1' ); is( $select->options->[1]->{value}, '2' ); @@ -82,20 +82,20 @@ is( $select->options->[4]->{value}, '5' ); is( $select->options->[4]->{label}, 'user 5' ); } - + # band 2 { is( $bands[1]->nested_name, 'bands_2' ); is( $bands[1]->get_field('id')->default, '2' ); is( $bands[1]->get_field('band')->default, 'band 2' ); - + # user 3 my $select = $bands[1]->get_field('users'); is_deeply( $select->default, [5] ); - + is( scalar @{ $select->options }, 5 ); - + is( $select->options->[0]->{value}, '1' ); is( $select->options->[0]->{label}, 'user 1' ); is( $select->options->[1]->{value}, '2' ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/has_many_repeatable_select.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/has_many_repeatable_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/has_many_repeatable_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/has_many_repeatable_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,26 +4,26 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Hidden name: count - + - type: Repeatable nested_name: bands counter_name: count elements: - type: Hidden name: id - + - name: band - + - type: Checkboxgroup name: users model_config: resultset: User - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select_restricted.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select_restricted.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select_restricted.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select_restricted.t 2018-04-09 21:56:30.000000000 +0000 @@ -39,7 +39,7 @@ my $u2 = $master->create_related( 'user', { name => 'Paul' } ); $u2->add_to_bands($band1); - + # band 2 $u2->add_to_bands( { band => 'wings', manager => 1 } ); @@ -49,7 +49,7 @@ { $form->process; - + is_deeply( $form->get_field('bands')->options, [ { 'label_attributes' => {}, diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select_restricted.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select_restricted.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select_restricted.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select_restricted.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,10 +4,10 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: bands multiple: 1 @@ -15,6 +15,6 @@ model: Bands condition: manager: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select.t libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select.t --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select.t 2018-04-09 21:56:30.000000000 +0000 @@ -39,7 +39,7 @@ my $u2 = $master->create_related( 'user', { name => 'Paul' } ); $u2->add_to_bands($band1); - + # band 2 $u2->add_to_bands( { band => 'wings' } ); @@ -49,7 +49,7 @@ { $form->process; - + is_deeply( $form->get_field('bands')->options, [ { 'label_attributes' => {}, diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select.yml libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/options_from_model/many_to_many_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/options_from_model/many_to_many_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: bands multiple: 1 model_config: model: Bands - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/basic.yml libhtml-formfu-model-dbic-perl-2.03/t/update/basic.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/basic.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/basic.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,55 +4,55 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Password name: password_col - + - type: Checkbox name: checkbox_col value: foo - + - type: Select name: select_col options: - [1, one] - [2, two] - [3, three] - + - type: ComboBox name: combobox_col options: - [1, one] - [2, two] - [3, three] - + - type: Radio name: radio_col value: yes - + - type: Radio name: radio_col value: no - + - type: Radiogroup name: radiogroup_col values: [1, 2, 3] - + - type: Checkboxgroup name: array_col options: - [one] - [two] - [three] - + - type: Text name: date_col - + - type: Text name: unknown_col - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/belongs_to_lookup_table_combobox.t libhtml-formfu-model-dbic-perl-2.03/t/update/belongs_to_lookup_table_combobox.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/belongs_to_lookup_table_combobox.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/belongs_to_lookup_table_combobox.t 2018-04-09 21:56:30.000000000 +0000 @@ -22,7 +22,7 @@ # insert some entries we'll ignore, so our rels don't have same ids $rs->create( { id => 1 } ); $rs->create( { id => 2 } ); - + # types my $type_rs = $schema->resultset('Type'); $type_rs->delete; @@ -42,7 +42,7 @@ "type_select" => '2', "type_text" => '', } ); - + $form->model->update($master); my $row = $rs->find(3); @@ -61,7 +61,7 @@ "type_select" => '', "type_text" => 'type 4', } ); - + $form->model->update($master); my $row = $rs->find(3); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/belongs_to_lookup_table_combobox.yml libhtml-formfu-model-dbic-perl-2.03/t/update/belongs_to_lookup_table_combobox.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/belongs_to_lookup_table_combobox.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/belongs_to_lookup_table_combobox.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,10 +4,10 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: ComboBox name: type # set this, so options_from_model() populates the menu, diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/belongs_to_select.t libhtml-formfu-model-dbic-perl-2.03/t/update/belongs_to_select.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/belongs_to_select.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/belongs_to_select.t 2018-04-09 21:56:30.000000000 +0000 @@ -9,54 +9,54 @@ { my $form = HTML::FormFu->new; - + $form->load_config_file('t/update/belongs_to_select.yml'); - + my $schema = new_schema(); - + $form->stash->{schema} = $schema; - + my $rs = $schema->resultset('Master'); - + $rs->create( { id => 1 } ); $rs->create( { id => 2 } ); - + my $master = $rs->create( { text_col => 'b', type_id => 2, type2_id => 2 } ); - + $form->process( { master => 2, note => 'foo' } ); - + $form->model->create; - + my $note = $schema->resultset("Note")->find(1); - + is($note->master->id, 2); - + is($note->note, 'foo'); } { my $form = HTML::FormFu->new; - + $form->load_config_file('t/update/belongs_to_select_two.yml'); - + my $schema = new_schema(); - + $form->stash->{schema} = $schema; - + my $rs = $schema->resultset('Master'); - + $rs->create( { id => 4 } ); $rs->create( { id => 5 } ); - + my $master = $rs->create( { text_col => 'b', type_id => 2, type2_id => 2 } ); - + $form->process( { id => 4, note => 'foo' } ); - + $form->model->create; - + my $note = $schema->resultset("TwoNote")->find(1); - + is($note->id->id, 4); - + is($note->note, 'foo'); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/column_without_field.yml libhtml-formfu-model-dbic-perl-2.03/t/update/column_without_field.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/column_without_field.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/column_without_field.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,9 +4,9 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_delete_true.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_delete_true.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_delete_true.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_delete_true.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,29 +4,29 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Checkbox name: delete model_config: delete_if_true: 1 - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_many_new_exceed_max.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_many_new_exceed_max.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_many_new_exceed_max.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_many_new_exceed_max.t 2018-04-09 21:56:30.000000000 +0000 @@ -30,23 +30,23 @@ 'addresses_3.address' => 'new office2', } ); - + ok( $form->submitted_and_valid ); - + my $row = $user_rs->new( {} ); - + $form->model('DBIC')->update($row); - + my $user = $user_rs->find(1); - + is( $user->name, 'new nick' ); - + my @add = $user->addresses->all; - + # 3rd address isn't inserted - + is( scalar @add, 2 ); - + is( $add[0]->id, 1 ); is( $add[0]->address, 'new home' ); is( $add[1]->id, 2 ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_many_new.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_many_new.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_many_new.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_many_new.t 2018-04-09 21:56:30.000000000 +0000 @@ -28,21 +28,21 @@ 'addresses_2.address' => 'new office', } ); - + ok( $form->submitted_and_valid ); - + my $row = $user_rs->new( {} ); - + $form->model('DBIC')->update($row); - + my $user = $user_rs->find(1); - + is( $user->name, 'new nick' ); - + my @add = $user->addresses->all; - + is( scalar @add, 2 ); - + is( $add[0]->id, 1 ); is( $add[0]->address, 'new home' ); is( $add[1]->id, 2 ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_date.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_date.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_date.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_date.t 2018-04-09 21:56:30.000000000 +0000 @@ -20,13 +20,13 @@ { # user 1 my $m1 = $master_rs->create( { text_col => 'foo' } ); - + # schedule 1 $m1->create_related( 'schedules', { date => DateTime->new( year => 2008, month => 7, day => 16 ), note => 'a', } ); - + # schedule 2 $m1->create_related( 'schedules', { date => DateTime->new( year => 2008, month => 7, day => 17 ), @@ -38,7 +38,7 @@ { # user 2 my $m2 = $master_rs->create( { text_col => 'orig text', } ); - + # schedule 3 $m2->create_related( 'schedules', { date => DateTime->new( year => 2008, month => 7, day => 18 ), @@ -74,14 +74,14 @@ is( scalar @schedule, 1 ); is( $schedule[0]->id, 3 ); - + my $date = $schedule[0]->date; - + isa_ok( $date, 'DateTime' ); - + is( $date->year, 2008 ); is( $date->month, 7 ); is( $date->day, 19 ); - + is( $schedule[0]->note, 'hi' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_date.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_date.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_date.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_date.yml 2018-04-09 21:56:30.000000000 +0000 @@ -21,7 +21,7 @@ auto_inflate: 1 constraints: - Required - + - name: note constraints: - Required diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_dependon.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_dependon.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_dependon.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_dependon.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,29 +4,29 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 2 - + elements: - type: Hidden name: id constraints: - type: DependOn others: address - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_implicit.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_implicit.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_implicit.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_implicit.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,26 +4,26 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 1 - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_required_when.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_required_when.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_required_when.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_required_when.t 2018-04-09 21:56:30.000000000 +0000 @@ -14,7 +14,7 @@ # a form is created with 'empty_rows' => 2 # but only 1 new row is filled in -# test using a Required constraint +# test using a Required constraint # with 'when' pointing to the PK field my $schema = new_schema(); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_required_when.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_required_when.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new_required_when.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new_required_when.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,30 +4,30 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 2 - + elements: - type: Hidden name: id - + - type: Text name: address constraints: - type: Required when: field: 'addresses.id' - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable_new.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable_new.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,27 +4,27 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count model_config: empty_rows: 1 new_rows_max: 1 - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_many_repeatable.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_many_repeatable.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,24 +4,24 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: addresses counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: address - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_create.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_create.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_create.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_create.t 2018-04-09 21:56:30.000000000 +0000 @@ -39,11 +39,11 @@ "text_col" => 'a', "user.name" => 'bar', } ); - + ok( $form->submitted_and_valid ); my $row = $schema->resultset('Master')->find(3); - + $form->model->update($row); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_no_id.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_no_id.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_no_id.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_no_id.t 2018-04-09 21:56:30.000000000 +0000 @@ -39,11 +39,11 @@ "text_col" => 'a', "user.name" => 'bar', } ); - + ok( $form->submitted_and_valid ); my $row = $schema->resultset('Master')->find(3); - + $form->model->update($row); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_no_id.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_no_id.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_no_id.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_no_id.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: user elements: - type: Text name: name - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_select.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_select.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_select.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_select.t 2018-04-09 21:56:30.000000000 +0000 @@ -45,21 +45,21 @@ "text_col" => 'a', "user" => 1, } ); - + ok( $form->submitted_and_valid ); my $row = $schema->resultset('Master')->find(3); - + $form->model->update($row); - + is($row->user->id, 1); - + $form->process( { "id" => 3, "text_col" => 'a', "user" => 99, } ); - + ok( $form->submitted_and_valid ); } @@ -67,19 +67,19 @@ my $row = $schema->resultset('Master')->find(3); $form->model->update($row); - + is($row->user->id, 1); - + $form = HTML::FormFu->new; - + $form->stash->{schema} = $schema; $form->load_config_file('t/update/has_one_select.yml'); - + $form->model->default_values($row); - + $form->process; - + like($form, qr/value="1" selected=/); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_select.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,14 +4,14 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Select name: user model_config: resultset: User - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one.t libhtml-formfu-model-dbic-perl-2.03/t/update/has_one.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one.t 2018-04-09 21:56:30.000000000 +0000 @@ -43,11 +43,11 @@ "user.id" => 2, "user.name" => 'bar', } ); - + ok( $form->submitted_and_valid ); my $row = $schema->resultset('Master')->find(3); - + $form->model->update($row); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/has_one.yml libhtml-formfu-model-dbic-perl-2.03/t/update/has_one.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/has_one.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/has_one.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,18 +4,18 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: user elements: - type: Hidden name: id - + - type: Text name: name - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_read_only.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_read_only.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_read_only.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_read_only.t 2018-04-09 21:56:30.000000000 +0000 @@ -33,10 +33,10 @@ # band 2 $u2->add_to_bands({ band => 'wings' }); - + # band 3 - not used $schema->resultset('Band')->create({ band => 'the kinks' }); - + # band 1 $u2->add_to_bands($band1); } @@ -60,7 +60,7 @@ { my $row = $schema->resultset('User')->find(2); - + is( $row->name, 'John Lennon' ); my @bands = $row->bands->all; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_read_only.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_read_only.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_read_only.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_read_only.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,15 +4,15 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Checkboxgroup name: bands model_config: read_only: 1 options_from_model: 0 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_restricted.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_restricted.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_restricted.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_restricted.t 2018-04-09 21:56:30.000000000 +0000 @@ -39,7 +39,7 @@ my $u2 = $master->create_related( 'user', { name => 'Paul' } ); $u2->add_to_bands($band1); - + # band 2 $schema->resultset('Band')->create( { band => 'wings', manager => 1 } ); @@ -66,7 +66,7 @@ { my $row = $schema->resultset('User')->find(2); - + is( $row->name, 'Paul McCartney' ); my @bands = $row->bands->all; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_restricted.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_restricted.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_restricted.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_restricted.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,16 +4,16 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Checkboxgroup name: bands model_config: model: Bands condition: manager: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup.t 2018-04-09 21:56:30.000000000 +0000 @@ -33,10 +33,10 @@ # band 2 $u2->add_to_bands({ band => 'wings' }); - + # band 3 - not used $schema->resultset('Band')->create({ band => 'the kinks' }); - + # band 1 $u2->add_to_bands($band1); } @@ -60,7 +60,7 @@ { my $row = $schema->resultset('User')->find(2); - + is( $row->name, 'Paul McCartney' ); my @bands = $row->bands->all; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_unselected.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_unselected.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup_unselected.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup_unselected.t 2018-04-09 21:56:30.000000000 +0000 @@ -33,10 +33,10 @@ # band 2 $u2->add_to_bands({ band => 'wings' }); - + # band 3 - not used $schema->resultset('Band')->create({ band => 'the kinks' }); - + # band 1 $u2->add_to_bands($band1); } @@ -61,7 +61,7 @@ { my $row = $schema->resultset('User')->find(2); - + is( $row->name, 'Paul McCartney' ); my @bands = $row->bands->all; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_checkboxgroup.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_checkboxgroup.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,12 +4,12 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Checkboxgroup name: bands - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many-has_many.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many-has_many.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many-has_many.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many-has_many.t 2018-04-09 21:56:30.000000000 +0000 @@ -102,12 +102,12 @@ # address 2 is( $address[0]->id, 2 ); is( $address[0]->address, 'add 2 edit' ); - + # address 3 is( $address[1]->id, 3 ); is( $address[1]->address, 'add 3 edit' ); } - + # user 6 { is( $user[1]->id, 6 ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_repeatable_new.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_repeatable_new.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_repeatable_new.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_repeatable_new.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,25 +4,25 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: bands counter_name: count model_config: new_rows_max: 1 - + elements: - type: Hidden name: id - + - type: Text name: band - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_repeatable.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_repeatable.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_repeatable.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_repeatable.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,23 +4,23 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Repeatable nested_name: bands counter_name: count - + elements: - type: Hidden name: id - + - type: Text name: band - + - type: Hidden name: count - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select_additive.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select_additive.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select_additive.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select_additive.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,10 +4,10 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: bands multiple: 1 @@ -16,6 +16,6 @@ options_from_model: 0 link_values: rating: 100 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select.t 2018-04-09 21:56:30.000000000 +0000 @@ -33,10 +33,10 @@ # band 2 $u2->add_to_bands({ band => 'wings' }); - + # band 3 - not used $schema->resultset('Band')->create({ band => 'the kinks' }); - + # band 1 $u2->add_to_bands($band1); } @@ -60,7 +60,7 @@ { my $row = $schema->resultset('User')->find(2); - + is( $row->name, 'Paul McCartney' ); my @bands = $row->bands->all; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select_unselected.t libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select_unselected.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select_unselected.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select_unselected.t 2018-04-09 21:56:30.000000000 +0000 @@ -33,10 +33,10 @@ # band 2 $u2->add_to_bands({ band => 'wings' }); - + # band 3 - not used $schema->resultset('Band')->create({ band => 'the kinks' }); - + # band 1 $u2->add_to_bands($band1); } @@ -61,7 +61,7 @@ { my $row = $schema->resultset('User')->find(2); - + is( $row->name, 'Paul McCartney' ); my @bands = $row->bands->all; diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select.yml libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/many_to_many_select.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/many_to_many_select.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,13 +4,13 @@ elements: - type: Hidden name: id - + - type: Text name: name - + - type: Select name: bands multiple: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/methods.t libhtml-formfu-model-dbic-perl-2.03/t/update/methods.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/methods.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/methods.t 2018-04-09 21:56:30.000000000 +0000 @@ -41,13 +41,13 @@ my $form = HTML::FormFu->new; $form->load_config_file('t/update/methods.yml'); - + $form->process({ method_test => 'apejens2', }); my $row = $rs->find(1); $form->model->update($row); - + is( $row->text_col, 'apejens2' ); is( $row->checkbox_col, 0); is( $row->method_checkbox_test, 0); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/might_have_delete_if_empty.yml libhtml-formfu-model-dbic-perl-2.03/t/update/might_have_delete_if_empty.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/might_have_delete_if_empty.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/might_have_delete_if_empty.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,10 +4,10 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: note elements: @@ -15,6 +15,6 @@ name: note model_config: delete_if_empty: 1 - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/might_have.t libhtml-formfu-model-dbic-perl-2.03/t/update/might_have.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/might_have.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/might_have.t 2018-04-09 21:56:30.000000000 +0000 @@ -43,9 +43,9 @@ "note.id" => 2, "note.note" => 'abc', } ); - + my $row = $schema->resultset('Master')->find(3); - + $form->model->update($row); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/might_have.yml libhtml-formfu-model-dbic-perl-2.03/t/update/might_have.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/might_have.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/might_have.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,18 +4,18 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Block nested_name: note elements: - type: Hidden name: id - + - type: Textarea name: note - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/nested_name_accessor.t libhtml-formfu-model-dbic-perl-2.03/t/update/nested_name_accessor.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/nested_name_accessor.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/nested_name_accessor.t 2018-04-09 21:56:30.000000000 +0000 @@ -44,7 +44,7 @@ 'name' => 'Mr. Foo', 'foo.value' => 'e', } ); - + my $row = $schema->resultset('User')->find(2); $form->model->update($row); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/nested.yml libhtml-formfu-model-dbic-perl-2.03/t/update/nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,48 +5,48 @@ elements: - type: Hidden name: id - + - type: Text name: text_col - + - type: Password name: password_col - + - type: Checkbox name: checkbox_col value: foo - + - type: Select name: select_col options: - [1, one] - [2, two] - [3, three] - + - type: ComboBox name: combobox_col options: - [1, one] - [2, two] - [3, three] - + - type: Radio name: radio_col value: yes - + - type: Radio name: radio_col value: no - + - type: Radiogroup name: radiogroup_col values: [1, 2, 3] - + - type: Text name: date_col - + - type: Text name: unknown_col - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/null_if_empty.t libhtml-formfu-model-dbic-perl-2.03/t/update/null_if_empty.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/null_if_empty.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/null_if_empty.t 2018-04-09 21:56:30.000000000 +0000 @@ -1,70 +1,70 @@ -use strict; -use warnings; -use Test::More tests => 7; - -use HTML::FormFu; -use lib 't/lib'; -use DBICTestLib 'new_schema'; -use MySchema; - -my $form = HTML::FormFu->new; - -$form->load_config_file('t/update/null_if_empty.yml'); - -my $schema = new_schema(); - -my $rs = $schema->resultset('User')->create( { - name => "foo", - } ); - -is( $rs->name, "foo" ); - -{ - $form->process( { name => "foo", title => "" } ); - - $form->model->update($rs); - - is( $rs->title, undef ); -} - -{ - $form->process( { name => "foo", title => 'test' } ); - - $form->model->update($rs); - - is( $rs->title, "test" ); -} - -{ - $form->process( { name => "foo", title => undef } ); - - $form->model->update($rs); - - is( $rs->title, undef ); -} - -{ - $form->process( { name => "foo", title => 0 } ); - - $form->model->update($rs); - - is( $rs->title, "0" ); -} - -{ - $form->process( { name => "foo", title => " " } ); - - $form->model->update($rs); - - is( $rs->title, " " ); -} - -{ - $form->get_element( name => 'title' )->model_config->{null_if_empty} = 0; - - $form->process( { name => "foo", title => "" } ); - - $form->model->update($rs); - - is( $rs->title, "" ); -} +use strict; +use warnings; +use Test::More tests => 7; + +use HTML::FormFu; +use lib 't/lib'; +use DBICTestLib 'new_schema'; +use MySchema; + +my $form = HTML::FormFu->new; + +$form->load_config_file('t/update/null_if_empty.yml'); + +my $schema = new_schema(); + +my $rs = $schema->resultset('User')->create( { + name => "foo", + } ); + +is( $rs->name, "foo" ); + +{ + $form->process( { name => "foo", title => "" } ); + + $form->model->update($rs); + + is( $rs->title, undef ); +} + +{ + $form->process( { name => "foo", title => 'test' } ); + + $form->model->update($rs); + + is( $rs->title, "test" ); +} + +{ + $form->process( { name => "foo", title => undef } ); + + $form->model->update($rs); + + is( $rs->title, undef ); +} + +{ + $form->process( { name => "foo", title => 0 } ); + + $form->model->update($rs); + + is( $rs->title, "0" ); +} + +{ + $form->process( { name => "foo", title => " " } ); + + $form->model->update($rs); + + is( $rs->title, " " ); +} + +{ + $form->get_element( name => 'title' )->model_config->{null_if_empty} = 0; + + $form->process( { name => "foo", title => "" } ); + + $form->model->update($rs); + + is( $rs->title, "" ); +} diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/null_if_empty.yml libhtml-formfu-model-dbic-perl-2.03/t/update/null_if_empty.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/null_if_empty.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/null_if_empty.yml 2018-04-09 21:56:30.000000000 +0000 @@ -1,12 +1,12 @@ ---- -model_config: - resultset: User - -elements: - - type: Text - name: name - - type: Text - name: title - model_config: - null_if_empty: 1 - +--- +model_config: + resultset: User + +elements: + - type: Text + name: name + - type: Text + name: title + model_config: + null_if_empty: 1 + diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor_nested.t libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor_nested.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor_nested.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor_nested.t 2018-04-09 21:56:30.000000000 +0000 @@ -36,7 +36,7 @@ 'foo.id' => 2, 'foo.fullname' => 'mr billy bob', } ); - + my $row = $schema->resultset('User')->find(2); $form->model->update( $row, { nested_base => 'foo' } ); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor_nested.yml libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor_nested.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor_nested.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor_nested.yml 2018-04-09 21:56:30.000000000 +0000 @@ -5,11 +5,11 @@ elements: - type: Hidden name: id - + - type: Text name: fullname model_config: accessor: fullname - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor.t libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor.t --- libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor.t 2018-04-09 21:56:30.000000000 +0000 @@ -36,7 +36,7 @@ id => 2, fullname => 'mr billy bob', } ); - + my $row = $schema->resultset('User')->find(2); $form->model->update($row); diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor.yml libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor.yml --- libhtml-formfu-model-dbic-perl-2.00/t/update/opt_accessor.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/update/opt_accessor.yml 2018-04-09 21:56:30.000000000 +0000 @@ -4,11 +4,11 @@ elements: - type: Hidden name: id - + - type: Text name: fullname model_config: accessor: fullname - + - type: Submit name: submit diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/x_roundtrip/checkbox_false2true.t libhtml-formfu-model-dbic-perl-2.03/t/x_roundtrip/checkbox_false2true.t --- libhtml-formfu-model-dbic-perl-2.00/t/x_roundtrip/checkbox_false2true.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/x_roundtrip/checkbox_false2true.t 2018-04-09 21:56:30.000000000 +0000 @@ -28,21 +28,21 @@ { my $form = HTML::FormFu->new; - + $form->load_config_file( $config_file ); - + my $row = $rs->find(2); $form->model->default_values($row); - + # check field value my $checkbox = $form->get_field('checkbox_col'); - + is( $checkbox->default, '0' ); - + my $expected_xhtml = q{}; - + like( "$checkbox", qr/\Q$expected_xhtml\E/ ); } @@ -51,20 +51,20 @@ { my $form = HTML::FormFu->new; - + $form->load_config_file( $config_file ); - + $form->process({ id => '2', checkbox_col => '1', }); - + my $row = $rs->find(2); $form->model->update($row); - + # check database - + is( $row->checkbox_col, '1' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/x_roundtrip/checkbox_true2false.t libhtml-formfu-model-dbic-perl-2.03/t/x_roundtrip/checkbox_true2false.t --- libhtml-formfu-model-dbic-perl-2.00/t/x_roundtrip/checkbox_true2false.t 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/x_roundtrip/checkbox_true2false.t 2018-04-09 21:56:30.000000000 +0000 @@ -28,21 +28,21 @@ { my $form = HTML::FormFu->new; - + $form->load_config_file( $config_file ); - + my $row = $rs->find(2); $form->model->default_values($row); - + # check field value my $checkbox = $form->get_field('checkbox_col'); - + is( $checkbox->default, '1' ); - + my $expected_xhtml = q{}; - + like( "$checkbox", qr/\Q$expected_xhtml\E/ ); } @@ -51,19 +51,19 @@ { my $form = HTML::FormFu->new; - + $form->load_config_file( $config_file ); - + $form->process({ id => 2, }); - + my $row = $rs->find(2); $form->model->update($row); - + # check database - + is( $row->checkbox_col, '0' ); } diff -Nru libhtml-formfu-model-dbic-perl-2.00/t/x_roundtrip/checkbox.yml libhtml-formfu-model-dbic-perl-2.03/t/x_roundtrip/checkbox.yml --- libhtml-formfu-model-dbic-perl-2.00/t/x_roundtrip/checkbox.yml 2014-05-05 13:19:42.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/t/x_roundtrip/checkbox.yml 2018-04-09 21:56:30.000000000 +0000 @@ -1,6 +1,6 @@ --- elements: - name: id - + - type: Checkbox name: checkbox_col diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/author/00-compile.t libhtml-formfu-model-dbic-perl-2.03/xt/author/00-compile.t --- libhtml-formfu-model-dbic-perl-2.00/xt/author/00-compile.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/author/00-compile.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,61 @@ +use 5.006; +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 + +use Test::More; + +plan tests => 3; + +my @module_files = ( + 'HTML/FormFu/Constraint/DBIC/Unique.pm', + 'HTML/FormFu/Model/DBIC.pm' +); + + + +# no fake home requested + +my @switches = ( + -d 'blib' ? '-Mblib' : '-Ilib', +); + +use File::Spec; +use IPC::Open3; +use IO::Handle; + +open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; + +my @warnings; +for my $lib (@module_files) +{ + # see L + my $stderr = IO::Handle->new; + + diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } + $^X, @switches, '-e', "require q[$lib]")) + if $ENV{PERL_COMPILE_TEST_DEBUG}; + + my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); + binmode $stderr, ':crlf' if $^O eq 'MSWin32'; + my @_warnings = <$stderr>; + waitpid($pid, 0); + is($?, 0, "$lib loaded ok"); + + shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ + and not eval { +require blib; blib->VERSION('1.01') }; + + if (@_warnings) + { + warn @_warnings; + push @warnings, @_warnings; + } +} + + + +is(scalar(@warnings), 0, 'no warnings found') + or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ); + + diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/author/critic.t libhtml-formfu-model-dbic-perl-2.03/xt/author/critic.t --- libhtml-formfu-model-dbic-perl-2.00/xt/author/critic.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/author/critic.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,7 @@ +#!perl + +use strict; +use warnings; + +use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; +all_critic_ok(); diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/author/eol.t libhtml-formfu-model-dbic-perl-2.03/xt/author/eol.t --- libhtml-formfu-model-dbic-perl-2.00/xt/author/eol.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/author/eol.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,15 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 + +use Test::More 0.88; +use Test::EOL; + +my @files = ( + 'lib/HTML/FormFu/Constraint/DBIC/Unique.pm', + 'lib/HTML/FormFu/Model/DBIC.pm' +); + +eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; +done_testing; diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/author/pod-syntax.t libhtml-formfu-model-dbic-perl-2.03/xt/author/pod-syntax.t --- libhtml-formfu-model-dbic-perl-2.00/xt/author/pod-syntax.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/author/pod-syntax.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,7 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. +use strict; use warnings; +use Test::More; +use Test::Pod 1.41; + +all_pod_files_ok(); diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/release/distmeta.t libhtml-formfu-model-dbic-perl-2.03/xt/release/distmeta.t --- libhtml-formfu-model-dbic-perl-2.00/xt/release/distmeta.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/release/distmeta.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,6 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::MetaTests. + +use Test::CPAN::Meta; + +meta_yaml_ok(); diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/release/kwalitee.t libhtml-formfu-model-dbic-perl-2.03/xt/release/kwalitee.t --- libhtml-formfu-model-dbic-perl-2.00/xt/release/kwalitee.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/release/kwalitee.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,9 @@ +# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 +use strict; +use warnings; +use Test::More 0.88; +use Test::Kwalitee 1.21 'kwalitee_ok'; + +kwalitee_ok(); + +done_testing; diff -Nru libhtml-formfu-model-dbic-perl-2.00/xt/release/pause-permissions.t libhtml-formfu-model-dbic-perl-2.03/xt/release/pause-permissions.t --- libhtml-formfu-model-dbic-perl-2.00/xt/release/pause-permissions.t 1970-01-01 00:00:00.000000000 +0000 +++ libhtml-formfu-model-dbic-perl-2.03/xt/release/pause-permissions.t 2018-04-09 21:56:30.000000000 +0000 @@ -0,0 +1,13 @@ +use strict; +use warnings; + +# this test was generated with Dist::Zilla::Plugin::Test::PAUSE::Permissions 0.003 + +use Test::More; +BEGIN { + plan skip_all => 'Test::PAUSE::Permissions required for testing pause permissions' + if $] < 5.010; +} +use Test::PAUSE::Permissions; + +all_permissions_ok();