[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.8-81-gd24de30

? sunnavy sunnavy at bestpractical.com
Thu Jun 10 09:57:26 EDT 2010


The branch, 3.8-trunk has been updated
       via  d24de30e6878fe0b7b69caa2a4b3108b32839cb0 (commit)
      from  0e4ce5cf03d2a8c27549b62dc58b8e5267ef0b24 (commit)

Summary of changes:
 lib/RT/ACL_Overlay.pm        |    9 ++++++++-
 lib/RT/Attributes_Overlay.pm |   11 ++++++++++-
 lib/RT/Report/Tickets.pm     |    9 ++++++++-
 3 files changed, 26 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit d24de30e6878fe0b7b69caa2a4b3108b32839cb0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jun 10 20:58:53 2010 +0800

    check must_redo_search when calling SUPER::_DoSearch as it may cause deep recursion

diff --git a/lib/RT/ACL_Overlay.pm b/lib/RT/ACL_Overlay.pm
index d645e40..518241f 100755
--- a/lib/RT/ACL_Overlay.pm
+++ b/lib/RT/ACL_Overlay.pm
@@ -315,7 +315,14 @@ sub _DoSearch {
    # $RT::Logger->debug("Now in ".$self."->_DoSearch");
     my $return = $self->SUPER::_DoSearch(@_);
   #  $RT::Logger->debug("In $self ->_DoSearch. return from SUPER::_DoSearch was $return");
-    $self->_BuildHash();
+    if ( $self->{'must_redo_search'} ) {
+        $RT::Logger->crit(
+"_DoSearch is not so successful as it still needs redo search, won't call _BuildHash"
+        );
+    }
+    else {
+        $self->_BuildHash();
+    }
     return ($return);
 }
 
diff --git a/lib/RT/Attributes_Overlay.pm b/lib/RT/Attributes_Overlay.pm
index ebe8c4c..2a9dbb8 100644
--- a/lib/RT/Attributes_Overlay.pm
+++ b/lib/RT/Attributes_Overlay.pm
@@ -72,7 +72,16 @@ no warnings qw(redefine);
 sub _DoSearch {
     my $self = shift;
     $self->SUPER::_DoSearch();
-    $self->_BuildAccessTable();
+# if _DoSearch doesn't fully succeed, 'must_redo_search' will be true
+# and call _BuildAccessTable then will result in a deep recursion
+    if ( $self->{'must_redo_search'} ) {
+        $RT::Logger->crit(
+"_DoSearch is not so successful as it still needs redo search, won't call _BuildAccessTable"
+        );
+    }
+    else {
+        $self->_BuildAccessTable();
+    }
 }
 
 
diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index c34d1cb..71ab007 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -166,7 +166,14 @@ columns if it makes sense
 sub _DoSearch {
     my $self = shift;
     $self->SUPER::_DoSearch( @_ );
-    $self->AddEmptyRows;
+    if ( $self->{'must_redo_search'} ) {
+        $RT::Logger->crit(
+"_DoSearch is not so successful as it still needs redo search, won't call AddEmptyRows"
+        );
+    }
+    else {
+        $self->AddEmptyRows;
+    }
 }
 
 =head2 _FieldToFunction FIELD

-----------------------------------------------------------------------


More information about the Rt-commit mailing list