[Rt-commit] r9328 - rt/branches/3.7-RTIR-RELENG/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Tue Oct 16 14:38:17 EDT 2007


Author: ruz
Date: Tue Oct 16 14:38:17 2007
New Revision: 9328

Modified:
   rt/branches/3.7-RTIR-RELENG/lib/RT/Record.pm

Log:
* in forms we output empty values instead of zero, so we should
  treat incomming value in the same way

Modified: rt/branches/3.7-RTIR-RELENG/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/lib/RT/Record.pm	(original)
+++ rt/branches/3.7-RTIR-RELENG/lib/RT/Record.pm	Tue Oct 16 14:38:17 2007
@@ -870,13 +870,18 @@
         # This is in an eval block because $object might not exist.
         # and might not have a Name method. But "can" won't find autoloaded
         # items. If it fails, we don't care
-        do { no warnings "uninitialized";
+        do {
+            no warnings "uninitialized";
+            local $@;
             eval {
                 my $object = $attribute . "Obj";
-                next if $self->$object->Name eq $value;
+                my $name = $self->$object->Name;
+                next if $name eq $value || $name eq ($value || 0);
             };
             next if $value eq $self->$attribute();
+            next if ($value || 0) eq $self->$attribute();
         };
+
         my $method = "Set$attribute";
         my ( $code, $msg ) = $self->$method($value);
         my ($prefix) = ref($self) =~ /RT(?:.*)::(\w+)/;


More information about the Rt-commit mailing list