[Rt-commit] r16650 - rt/3.8/trunk/lib/RT

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Nov 2 21:14:17 EST 2008


Author: sunnavy
Date: Sun Nov  2 21:14:17 2008
New Revision: 16650

Modified:
   rt/3.8/trunk/lib/RT/CustomField_Overlay.pm

Log:
fix for CustomField's LoadByName to be backward compatible

Modified: rt/3.8/trunk/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/CustomField_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/CustomField_Overlay.pm	Sun Nov  2 21:14:17 2008
@@ -319,7 +319,11 @@
 
     # We only want one entry.
     $CFs->RowsPerPage(1);
-    return (0, $self->loc("Not found")) unless my $first = $CFs->First;
+
+    # version before 3.8 just returns 0, so we need to test if wantarray to be
+    # backward compatible.
+    return wantarray ? (0, $self->loc("Not found")) : 0 unless my $first = $CFs->First;
+
     return $self->LoadById( $first->id );
 }
 


More information about the Rt-commit mailing list