[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-130-gfca2797

Shawn Moore sartak at bestpractical.com
Thu Jul 8 16:59:35 EDT 2010


The branch, 3.9-trunk has been updated
       via  fca2797a2b6ab91e28f877730452039f248d2b88 (commit)
      from  bda1fdbd3ccb62362f4a46bef2c1ddcd075916da (commit)

Summary of changes:
 lib/RT/SharedSetting.pm |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit fca2797a2b6ab91e28f877730452039f248d2b88
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Jul 8 17:00:53 2010 -0400

    Make _GetObject($obj) just return $obj

diff --git a/lib/RT/SharedSetting.pm b/lib/RT/SharedSetting.pm
index 63deb98..e92f9cd 100644
--- a/lib/RT/SharedSetting.pm
+++ b/lib/RT/SharedSetting.pm
@@ -65,6 +65,7 @@ package RT::SharedSetting;
 use strict;
 use warnings;
 use RT::Attribute;
+use Scalar::Util 'blessed';
 use base qw/RT::Base/;
 
 =head1 METHODS
@@ -372,6 +373,11 @@ sub _GetObject {
     my $self = shift;
     my $privacy = shift;
 
+    # short circuit: if they pass the object we want anyway, just return it
+    if (blessed($privacy) && $privacy->isa('RT::Record')) {
+        return $privacy;
+    }
+
     my ($obj_type, $obj_id) = split(/\-/, ($privacy || ''));
 
     unless ($obj_type && $obj_id) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list