summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Attributes_Overlay.pm
diff options
context:
space:
mode:
authorivan <ivan>2009-12-31 13:16:41 +0000
committerivan <ivan>2009-12-31 13:16:41 +0000
commitb4b0c7e72d7eaee2fbfc7022022c9698323203dd (patch)
treeba4cd21399e412c32fe3737eaa8478e3271509f9 /rt/lib/RT/Attributes_Overlay.pm
parent2dfda73eeb3eae2d4f894099754794ef07d060dd (diff)
import rt 3.8.7
Diffstat (limited to 'rt/lib/RT/Attributes_Overlay.pm')
-rw-r--r--rt/lib/RT/Attributes_Overlay.pm43
1 files changed, 25 insertions, 18 deletions
diff --git a/rt/lib/RT/Attributes_Overlay.pm b/rt/lib/RT/Attributes_Overlay.pm
index e0c2f5a..ebe8c4c 100644
--- a/rt/lib/RT/Attributes_Overlay.pm
+++ b/rt/lib/RT/Attributes_Overlay.pm
@@ -1,8 +1,8 @@
# BEGIN BPS TAGGED BLOCK {{{
#
# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+#
+# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
# <jesse@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -45,14 +45,15 @@
# those contributions and any derivatives thereof.
#
# END BPS TAGGED BLOCK }}}
+
=head1 NAME
- RT::Attributes - collection of RT::Attribute objects
+RT::Attributes - collection of RT::Attribute objects
=head1 SYNOPSIS
- use RT::Attributes;
-my $Attributes = new RT::Attributes($CurrentUser);
+ use RT::Attributes;
+ my $Attributes = new RT::Attributes($CurrentUser);
=head1 DESCRIPTION
@@ -154,22 +155,28 @@ the matching name.
sub DeleteEntry {
my $self = shift;
- my %args = ( Name => undef,
- Content => undef,
- id => undef,
- @_);
+ my %args = (
+ Name => undef,
+ Content => undef,
+ id => undef,
+ @_
+ );
my $found = 0;
- foreach my $attr ($self->Named($args{'Name'})){
- if ((!defined $args{'id'} and !defined $args{'Content'})
- or (defined $args{'id'} and $attr->id eq $args{'id'})
- or (defined $args{'Content'} and $attr->Content eq $args{'Content'})) {
- my ($id, $msg) = $attr->Delete;
- return ($id, $msg) unless $id;
- $found = 1;
- }
+ foreach my $attr ( $self->Named( $args{'Name'} ) ) {
+ if ( ( !defined $args{'id'} and !defined $args{'Content'} )
+ or ( defined $args{'id'} and $attr->id eq $args{'id'} )
+ or ( defined $args{'Content'} and $attr->Content eq $args{'Content'} ) )
+ {
+ my ($id, $msg) = $attr->Delete;
+ return ($id, $msg) unless $id;
+ $found = 1;
+ }
}
return (0, "No entry found") unless $found;
- $self->_DoSearch();
+ $self->RedoSearch;
+ # XXX: above string must work but because of bug in DBIx::SB it doesn't,
+ # to reproduce delete string below and run t/api/attribute-tests.t
+ $self->_DoSearch;
return (1, $self->loc('Attribute Deleted'));
}