[Rt-commit] rt branch, googleish-refactor, updated. rt-3.8.5-208-g37752bd
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sun Oct 11 23:58:15 EDT 2009
The branch, googleish-refactor has been updated
via 37752bdaf5edd05355c3425da211351a02a3aff0 (commit)
from 56ead7bb06097b012362a77988be1ebcb90c2550 (commit)
Summary of changes:
lib/RT/Search/Googleish.pm | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 37752bdaf5edd05355c3425da211351a02a3aff0
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon Oct 12 11:58:07 2009 +0800
Load returns a list, not a scalar
diff --git a/lib/RT/Search/Googleish.pm b/lib/RT/Search/Googleish.pm
index 87270e6..d4d7161 100644
--- a/lib/RT/Search/Googleish.pm
+++ b/lib/RT/Search/Googleish.pm
@@ -237,8 +237,8 @@ sub TranslateQueue {
my $key = shift;
my @clauses;
my $Queue = RT::Queue->new( $self->TicketsObj->CurrentUser );
- $Queue->Load($key);
- if ( $Queue->Id ) {
+ my ( $ret ) = $Queue->Load($key);
+ if ( $ret && $Queue->Id ) {
my $quoted_queue = $Queue->Name;
$quoted_queue =~ s/'/\\'/g;
push @clauses, "Queue = '$quoted_queue'";
@@ -261,7 +261,8 @@ sub TranslateOwner {
my $key = shift;
my @clauses;
my $User = RT::User->new( $self->TicketsObj->CurrentUser );
- if ( $User->Load($key) && $User->Privileged ) {
+ my ( $ret ) = $User->Load($key);
+ if ( $ret && $User->Privileged ) {
push @clauses, "Owner = '" . $User->Name . "'";
}
return @clauses;
@@ -287,7 +288,8 @@ sub ProcessAfterTranslate {
# restrict to any queues requested by the caller
for my $queue ( @{ $self->{'Queues'} } ) {
my $QueueObj = RT::Queue->new( $self->TicketsObj->CurrentUser );
- $QueueObj->Load($queue) or next;
+ my ( $ret ) = $QueueObj->Load($queue);
+ next unless $ret;
my $quoted_queue = $QueueObj->Name;
$quoted_queue =~ s/'/\\'/g;
push @$queue_clauses, "Queue = '$quoted_queue'";
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list