From a64337532dfca30b712f0a02aeb2df557c0b2c47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 12 Jan 2015 17:04:47 +0100 Subject: [PATCH] PriceSource: Bessere Behandlung von Boolean Werten --- SL/Controller/PriceSource.pm | 4 ++++ bin/mozilla/io.pl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/SL/Controller/PriceSource.pm b/SL/Controller/PriceSource.pm index 9f8257c69..df505a60e 100644 --- a/SL/Controller/PriceSource.pm +++ b/SL/Controller/PriceSource.pm @@ -97,6 +97,8 @@ sub _make_record_item { $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"}); } @@ -147,6 +149,8 @@ sub _make_record { $obj->${\"$method\_as_date"}($::form->{$method}); } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { $obj->${\"$method\_as\_number"}($::form->{$method}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); } else { $obj->$method($::form->{$method}); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index f28c7b0de..64eb764ec 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1958,6 +1958,8 @@ sub _make_record_item { $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"}); } @@ -2004,6 +2006,8 @@ sub _make_record { $obj->${\"$method\_as_date"}($::form->{$method}); } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) { $obj->${\"$method\_as_number"}($::form->{$method}); + } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) { + $obj->$method(!!$::form->{$method}); } else { $obj->$method($::form->{$method}); } -- 2.20.1