projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b04c992
)
assign_attributes: nur leeren String und undef bei Zahlenspaletn auf NULL mappen...
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 30 Dec 2010 15:44:56 +0000
(16:44 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 30 Dec 2010 15:44:56 +0000
(16:44 +0100)
SL/DB/Object.pm
patch
|
blob
|
history
diff --git
a/SL/DB/Object.pm
b/SL/DB/Object.pm
index
52b9300
..
5e58ed9
100644
(file)
--- a/
SL/DB/Object.pm
+++ b/
SL/DB/Object.pm
@@
-61,9
+61,10
@@
sub _assign_attributes {
while (my ($attribute, $value) = each %attributes) {
my $type = lc($types{$attribute} || 'text');
- $value = $type eq 'boolean' ? ($value ? 't' : 'f')
- : $text_column_types{$type} ? $value
- : ($value || undef);
+ $value = $type eq 'boolean' ? ($value ? 't' : 'f')
+ : $text_column_types{$type} ? $value
+ : defined($value) && ($value eq '') ? undef
+ : $value;
$self->$attribute($value);
}