[Bps-public-commit] r19792 - RT-BugTracker/html/Dist/Elements

sartak at bestpractical.com sartak at bestpractical.com
Thu May 28 16:08:43 EDT 2009


Author: sartak
Date: Thu May 28 16:08:43 2009
New Revision: 19792

Modified:
   RT-BugTracker/html/Dist/Elements/Tabs

Log:
Don't load a queue from the database when we already have a queue object

Modified: RT-BugTracker/html/Dist/Elements/Tabs
==============================================================================
--- RT-BugTracker/html/Dist/Elements/Tabs	(original)
+++ RT-BugTracker/html/Dist/Elements/Tabs	Thu May 28 16:08:43 2009
@@ -73,16 +73,19 @@
 
 my $queue_obj;
 if ( $Queue ) {
-    $Queue = $Queue->Id if ref($Queue);
-
-    my $tmp = RT::Queue->new( $session{'CurrentUser'} );
-    $tmp->Load( $Queue );
-    unless ( $tmp->id ) {
-        $RT::Logger->warning( "Couldn't load queue '$Queue'");
-    } else {
-        $queue_obj = $tmp;
+    if (ref($Queue)) {
+        $Queue = $Queue->Name;
+    }
+    else {
+        my $tmp = RT::Queue->new( $session{'CurrentUser'} );
+        $tmp->Load( $Queue );
+        unless ( $tmp->id ) {
+            $RT::Logger->warning( "Couldn't load queue '$Queue'");
+        } else {
+            $queue_obj = $tmp;
+        }
+        $Queue = $queue_obj->Name;
     }
-    $Queue = $queue_obj->Name;
 }
 
 my $escaped_queue = $m->interp->apply_escapes( $Queue, 'u' );



More information about the Bps-public-commit mailing list