Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Thu, 11 Jan 2018 06:46:31 +0000 (22:46 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 11 Jan 2018 06:46:31 +0000 (22:46 -0800)
1  2 
httemplate/edit/elements/edit.html

@@@ -358,7 -358,6 +358,7 @@@ Example
  %     #contact
  %     'custnum'     => $f->{'custnum'},
  %     'prospectnum' => $f->{'prospectnum'},
 +%
  %   );
  %
  %   $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
  %     qw( formatted_value ),                               #fixed
  %     qw( country ),                                       #select-country
  %     qw( width height config ),                           #htmlarea
 -%     qw( alt_format ),                                    #select-cust_location
 +%     qw( is_optional alt_format ),                        #select-cust_location
  %     qw( classnum ),                                   # select-inventory_item
  %     qw( aligned ),                                    # columnstart
  %     qw( debug ),                                      # select-table
@@@ -872,7 -871,9 +872,9 @@@ my $pkey = dbdef->table($table)->primar
  my $fields = $opt{'fields'}
               #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ];
               || [ grep { $_ ne $pkey } fields($table) ];
- #my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+ my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
+ push @actualfields, $pkey;
  
  my $js_form_validate = {};
  
@@@ -915,7 -916,7 +917,7 @@@ if ( $opt{'embed'} ) 
      $mode = 'error';
  
      $object = $class->new( {
-       map { $_ => scalar($cgi->param($_)) } fields($table)
+       map { $_ => scalar($cgi->param($_)) } @actualfields
      });
  
      &{$opt{'error_callback'}}( $cgi, $object, $fields, \%opt )