From 1675af94a20b4e137e1cfcc74898071fd5c1be8d Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 24 May 2008 23:00:56 +0000 Subject: * fixed bug that would not allow setting an empty attribute to '0' git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1801 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/MetaDB/DBI.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config-db/OpenSLX/MetaDB/DBI.pm') diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm index 271463b5..4961cdcc 100644 --- a/config-db/OpenSLX/MetaDB/DBI.pm +++ b/config-db/OpenSLX/MetaDB/DBI.pm @@ -895,7 +895,9 @@ sub setSystemAttrs my @attrsToBeUpdated = grep { $valueIsOK->($newAttrs->{$_}) && exists $oldAttrs{$_} - && ($oldAttrs{$_}->{value} || '') ne ($newAttrs->{$_} || '') + && ((defined($oldAttrs{$_}->{value}) xor defined($newAttrs->{$_})) + || (defined($oldAttrs{$_}->{value}) && defined($newAttrs->{$_}) + && $oldAttrs{$_}->{value} ne $newAttrs->{$_})) } keys %$newAttrs; # ... insert the new ones ... -- cgit v1.2.3-55-g7522