--- trunk/lib/WebPAC/Validate.pm 2007/05/27 19:25:57 861 +++ trunk/lib/WebPAC/Validate.pm 2007/06/26 17:46:49 875 @@ -188,6 +188,7 @@ } else { $log->warn("delimiters path $path doesn't exist, it will be created after this run"); } + $self->{delimiters_path} = $path; } =head2 validate_rec @@ -272,6 +273,7 @@ # $errors->{dump} = $rec_dump if ($rec_dump); } elsif (ref($v) ne 'HASH') { $errors->{$f}->{missing_subfield} = join(",", @{ $r->{$f} }) . " required"; + $errors->{$f}->{dump} = $v; next; } else { @@ -372,7 +374,7 @@ $self->{_delimiters_templates}->{$f}->{$t}; } } - $log->debug("_accumulated_delimiters_templates = ", sub { dump( $self->{_accumulated_delimiter_templates} ) } ); + $log->debug("_accumulated_delimiters_templates = ", sub { dump( $self->{_accumulated_delimiters_templates} ) } ); delete ($self->{_delimiters_templates}); } @@ -566,18 +568,20 @@ sub save_delimiters_templates { my $self = shift; - my $path = $self->{delimiters_path}; - - return unless ( $path ); + my $path = shift; + $path ||= $self->{delimiters_path}; my $log = $self->_get_logger; + $log->logdie("need path") unless ( $path ); + + if ( ! $self->{_accumulated_delimiters_templates} ) { $log->error('no _accumulated_delimiters_templates found, reset'); $self->reset; } - if ( ! $self->{_delimiters_templates} ) { + if ( $self->{_delimiters_templates} ) { $log->error('found _delimiters_templates, calling reset'); $self->reset; }