make_record: Zusätzliche Formvariablen speichern.
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 5 Aug 2015 15:09:29 +0000 (17:09 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 5 Aug 2015 15:09:29 +0000 (17:09 +0200)
SL/Controller/PriceSource.pm
bin/mozilla/io.pl

index b7ee8bd..0c3eb87 100644 (file)
@@ -93,15 +93,18 @@ sub _make_record_item {
           : $class->new;
 
   for my $method (apply { s/_$row$// } grep { /_$row$/ } keys %$::form) {
-    next unless $obj->meta->column($method);
-    if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) {
-      $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
-    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
-      $obj->${\"$method\_as_number"}($::form->{"$method\_$row"});
-    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
-      $obj->$method(!!$::form->{$method});
+    if ($obj->meta->column($method)) {
+      if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) {
+        $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
+      } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
+        $obj->${\"$method\_as_number"}($::form->{"$method\_$row"});
+      } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
+        $obj->$method(!!$::form->{$method});
+      } else {
+        $obj->$method($::form->{"$method\_$row"});
+      }
     } else {
-      $obj->$method($::form->{"$method\_$row"});
+      $obj->{__additional_form_attributes}{$method} = $::form->{"$method\_$row"};
     }
   }
 
index 460adef..b9d2cc4 100644 (file)
@@ -2044,15 +2044,18 @@ sub _make_record_item {
           : $class->new;
 
   for my $method (apply { s/_$row$// } grep { /_$row$/ } keys %$::form) {
-    next unless $obj->meta->column($method);
-    if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) {
-      $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
-    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
-      $obj->${\"$method\_as_number"}($::form->{"$method\_$row"});
-    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
-      $obj->$method(!!$::form->{$method});
+    if ($obj->meta->column($method)) {
+      if ($obj->meta->column($method)->isa('Rose::DB::Object::Metadata::Column::Date')) {
+        $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
+      } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
+        $obj->${\"$method\_as_number"}($::form->{"$method\_$row"});
+      } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
+        $obj->$method(!!$::form->{$method});
+      } else {
+        $obj->$method($::form->{"$method\_$row"});
+      }
     } else {
-      $obj->$method($::form->{"$method\_$row"});
+      $obj->{__additional_form_attributes}{$method} = $::form->{"$method\_$row"};
     }
   }