[Rt-commit] r5476 - in rt/branches/3.4-RELEASE/lib/RT: URI
ruz at bestpractical.com
ruz at bestpractical.com
Tue Jun 27 17:21:11 EDT 2006
Author: ruz
Date: Tue Jun 27 17:21:07 2006
New Revision: 5476
Modified:
rt/branches/3.4-RELEASE/lib/RT/Link_Overlay.pm
rt/branches/3.4-RELEASE/lib/RT/Links_Overlay.pm
rt/branches/3.4-RELEASE/lib/RT/URI/base.pm
rt/branches/3.4-RELEASE/lib/RT/URI/fsck_com_rt.pm
Log:
* nothing special, small changes I'd changed during
the hunt over a bug
Modified: rt/branches/3.4-RELEASE/lib/RT/Link_Overlay.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Link_Overlay.pm (original)
+++ rt/branches/3.4-RELEASE/lib/RT/Link_Overlay.pm Tue Jun 27 17:21:07 2006
@@ -268,8 +268,8 @@
=cut
sub TargetObj {
- my $self = shift;
- return $self->TargetURI->Object;
+ my $self = shift;
+ return $self->TargetURI->Object;
}
# }}}
Modified: rt/branches/3.4-RELEASE/lib/RT/Links_Overlay.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Links_Overlay.pm (original)
+++ rt/branches/3.4-RELEASE/lib/RT/Links_Overlay.pm Tue Jun 27 17:21:07 2006
@@ -154,19 +154,17 @@
my $self = shift;
my $Link = $self->SUPER::Next();
- if ((defined($Link)) and (ref($Link))) {
- # Skip links to local objects thast are deleted
- if ($Link->TargetURI->IsLocal and UNIVERSAL::isa($Link->TargetObj,"RT::Ticket")
- and $Link->TargetObj->__Value('status') eq "deleted") {
- return $self->Next;
- } elsif ($Link->BaseURI->IsLocal and UNIVERSAL::isa($Link->BaseObj,"RT::Ticket")
- and $Link->BaseObj->__Value('status') eq "deleted") {
- return $self->Next;
- } else {
- return $Link;
- }
+ return $Link unless $Link && ref $Link;
+
+ # Skip links to local objects thast are deleted
+ if ( $Link->TargetURI->IsLocal and UNIVERSAL::isa($Link->TargetObj,"RT::Ticket")
+ and $Link->TargetObj->__Value('status') eq "deleted") {
+ return $self->Next;
+ } elsif ($Link->BaseURI->IsLocal and UNIVERSAL::isa($Link->BaseObj,"RT::Ticket")
+ and $Link->BaseObj->__Value('status') eq "deleted") {
+ return $self->Next;
} else {
- return undef;
+ return $Link;
}
}
Modified: rt/branches/3.4-RELEASE/lib/RT/URI/base.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/URI/base.pm (original)
+++ rt/branches/3.4-RELEASE/lib/RT/URI/base.pm Tue Jun 27 17:21:07 2006
@@ -81,12 +81,8 @@
my $self = shift;
my $obj = shift;
$self->{'uri'} = "unknown-object:".ref($obj);
-
-
}
-
-
sub ParseURI {
my $self = shift;
my $uri = shift;
Modified: rt/branches/3.4-RELEASE/lib/RT/URI/fsck_com_rt.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/URI/fsck_com_rt.pm (original)
+++ rt/branches/3.4-RELEASE/lib/RT/URI/fsck_com_rt.pm Tue Jun 27 17:21:07 2006
@@ -128,7 +128,7 @@
sub URIForObject {
my $self = shift;
my $obj = shift;
- return ($self->LocalURIPrefix."/".$self->ObjectType($obj)."/". $obj->Id);
+ return ($self->LocalURIPrefix ."/". $self->ObjectType($obj) ."/". $obj->Id);
}
@@ -143,12 +143,12 @@
my $self = shift;
my $uri = shift;
- if ( $uri =~ /^(\d+)$/ ) {
+ if ( $uri =~ /^\d+$/ ) {
my $ticket = RT::Ticket->new( $self->CurrentUser );
- $ticket->Load($uri);
+ $ticket->Load( $uri );
$self->{'uri'} = $ticket->URI;
$self->{'object'} = $ticket;
- return($ticket->id);
+ return ($ticket->id);
}
else {
$self->{'uri'} = $uri;
@@ -156,9 +156,8 @@
#If it's a local URI, load the ticket object and return its URI
if ( $self->IsLocal ) {
-
my $local_uri_prefix = $self->LocalURIPrefix;
- if ( $self->{'uri'} =~ /^$local_uri_prefix\/(.*?)\/(\d+)$/i ) {
+ if ( $self->{'uri'} =~ /^\Q$local_uri_prefix\E\/(.*?)\/(\d+)$/i ) {
my $type = $1;
my $id = $2;
@@ -192,9 +191,9 @@
sub IsLocal {
my $self = shift;
- my $local_uri_prefix = $self->LocalURIPrefix;
- if ($self->{'uri'} =~ /^$local_uri_prefix/i) {
- return 1;
+ my $local_uri_prefix = $self->LocalURIPrefix;
+ if ( $self->{'uri'} =~ /^\Q$local_uri_prefix/i ) {
+ return 1;
}
else {
return undef;
More information about the Rt-commit
mailing list