[Rt-commit] rt branch, 4.0/forbid-linking-deleted-tickets, updated. rt-4.0.0-196-gb3add23
? sunnavy
sunnavy at bestpractical.com
Fri May 13 00:57:10 EDT 2011
The branch, 4.0/forbid-linking-deleted-tickets has been updated
via b3add236e8d372860cbd830b75b258a95d8b650f (commit)
from 492bf317e1cc690e1c87f9d0e1004834e154f233 (commit)
Summary of changes:
lib/RT/Links.pm | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit b3add236e8d372860cbd830b75b258a95d8b650f
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri May 13 12:55:38 2011 +0800
no need to force search if the total count is 0
diff --git a/lib/RT/Links.pm b/lib/RT/Links.pm
index 37cf8c3..f9355f2 100644
--- a/lib/RT/Links.pm
+++ b/lib/RT/Links.pm
@@ -160,6 +160,11 @@ sub AddRecord {
sub Count {
my $self = shift;
+ my $inaccurate = $self->SUPER::Count;
+
+ # if no links at all, 0 is the accurate answer already.
+ return $inaccurate unless $inaccurate;
+
$self->_DoSearch if $self->{'must_redo_search'};
return $self->_RecordCount;
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list