[freeside-commits] freeside/rt/lib RT.pm, 1.5.2.1, 1.5.2.2 RT.pm.in, 1.1.1.8, 1.1.1.8.4.1

Ivan,,, ivan at wavetail.420.am
Mon Jun 21 21:11:06 PDT 2010


Update of /home/cvs/cvsroot/freeside/rt/lib
In directory wavetail.420.am:/tmp/cvs-serv8328

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	RT.pm RT.pm.in 
Log Message:
backport NoSignalHandlers patch to 1.9... should fix up RT initialization in freeside-selfservice-xmlrpcd such that processes still log after create_ticket happened, RT#7780

Index: RT.pm.in
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT.pm.in,v
retrieving revision 1.1.1.8
retrieving revision 1.1.1.8.4.1
diff -u -w -d -r1.1.1.8 -r1.1.1.8.4.1
--- RT.pm.in	2 Mar 2008 04:08:24 -0000	1.1.1.8
+++ RT.pm.in	22 Jun 2010 04:11:04 -0000	1.1.1.8.4.1
@@ -2,7 +2,7 @@
 # 
 # COPYRIGHT:
 #  
-# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC 
 #                                          <jesse at bestpractical.com>
 # 
 # (Except where explicitly superseded by other copyright notices)
@@ -24,7 +24,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/copyleft/gpl.html.
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
 # 
 # 
 # CONTRIBUTION SUBMISSION POLICY:
@@ -186,6 +186,8 @@
 
 sub Init {
 
+    my @arg = @_;
+
     CheckPerlRequirements();
 
     #Get a database connection
@@ -202,7 +204,7 @@
     $System = RT::System->new();
 
     InitClasses();
-    InitLogging(); 
+    InitLogging(@arg); 
 }
 
 
@@ -228,6 +230,8 @@
 
 sub InitLogging {
 
+    my %arg = @_;
+
     # We have to set the record separator ($, man perlvar)
     # or Log::Dispatch starts getting
     # really pissy, as some other module we use unsets it.
@@ -342,6 +346,8 @@
 ## Mason).  It will log all problems through the standard logging
 ## mechanism (see above).
 
+    unless ( $arg{'NoSignalHandlers'} ) {
+
     $SIG{__WARN__} = sub {
         # The 'wide character' warnings has to be silenced for now, at least
         # until HTML::Mason offers a sane way to process both raw output and
@@ -363,6 +369,8 @@
     die $_[0];
 };
 
+    }
+
 # }}}
 
 }
@@ -410,7 +418,9 @@
 sub InitClasses {
     require RT::Tickets;
     require RT::Transactions;
+    require RT::Attachments;
     require RT::Users;
+    require RT::Principals;
     require RT::CurrentUser;
     require RT::Templates;
     require RT::Queues;
@@ -423,6 +433,31 @@
     require RT::CustomFieldValues;
     require RT::ObjectCustomFields;
     require RT::ObjectCustomFieldValues;
+    require RT::Attributes;
+
+    # on a cold server (just after restart) people could have an object
+    # in the session, as we deserialize it so we never call constructor
+    # of the class, so the list of accessible fields is empty and we die
+    # with "Method xxx is not implemented in RT::SomeClass"
+    $_->_BuildTableAttributes foreach qw(
+        RT::Ticket
+        RT::Transaction
+        RT::Attachment
+        RT::User
+        RT::Principal
+        RT::Template
+        RT::Queue
+        RT::ScripAction
+        RT::ScripCondition
+        RT::Scrip
+        RT::Group
+        RT::GroupMember
+        RT::CustomField
+        RT::CustomFieldValue
+        RT::ObjectCustomField
+        RT::ObjectCustomFieldValue
+        RT::Attribute
+    );
 }
 
 # }}}

Index: RT.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT.pm,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -w -d -r1.5.2.1 -r1.5.2.2
--- RT.pm	31 Dec 2009 12:56:37 -0000	1.5.2.1
+++ RT.pm	22 Jun 2010 04:11:04 -0000	1.5.2.2
@@ -24,7 +24,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 # 
 # 
 # CONTRIBUTION SUBMISSION POLICY:
@@ -186,6 +186,8 @@
 
 sub Init {
 
+    my @arg = @_;
+
     CheckPerlRequirements();
 
     #Get a database connection
@@ -202,7 +204,7 @@
     $System = RT::System->new();
 
     InitClasses();
-    InitLogging(); 
+    InitLogging(@arg); 
 }
 
 
@@ -228,6 +230,8 @@
 
 sub InitLogging {
 
+    my %arg = @_;
+
     # We have to set the record separator ($, man perlvar)
     # or Log::Dispatch starts getting
     # really pissy, as some other module we use unsets it.
@@ -342,6 +346,8 @@
 ## Mason).  It will log all problems through the standard logging
 ## mechanism (see above).
 
+    unless ( $arg{'NoSignalHandlers'} ) {
+
     $SIG{__WARN__} = sub {
         # The 'wide character' warnings has to be silenced for now, at least
         # until HTML::Mason offers a sane way to process both raw output and
@@ -363,6 +369,8 @@
     die $_[0];
 };
 
+    }
+
 # }}}
 
 }



More information about the freeside-commits mailing list