X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT.pm;h=033e5e607b9271b74b4c8e14d91a1f1886f04dc5;hb=63a268637b2d51a8766412617724b9436439deb6;hp=0d0c0f5095cabbdfeabe4bfd28573c6b128e6c39;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/rt/lib/RT.pm b/rt/lib/RT.pm index 0d0c0f509..033e5e607 100644 --- a/rt/lib/RT.pm +++ b/rt/lib/RT.pm @@ -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 # # # (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: @@ -68,7 +68,7 @@ use vars qw($VERSION $System $SystemUser $Nobody $Handle $Logger $MasonSessionDir ); -$VERSION = '3.6.4'; +$VERSION = '3.6.10'; $CORE_CONFIG_FILE = "/opt/rt3/etc/RT_Config.pm"; $SITE_CONFIG_FILE = "/opt/rt3/etc/RT_SiteConfig.pm"; @@ -161,12 +161,12 @@ EOF } eval { require $CORE_CONFIG_FILE }; if ($@) { - my ($fileuid,$filegid) = (stat($SITE_CONFIG_FILE))[4,5]; + my ($fileuid,$filegid) = (stat($CORE_CONFIG_FILE))[4,5]; my $fileusername = getpwuid($fileuid); my $filegroup = getgrgid($filegid); - my $errormessage = sprintf($message, $SITE_CONFIG_FILE, + my $errormessage = sprintf($message, $CORE_CONFIG_FILE, $fileusername, $filegroup, $filegroup); - die ("$errormessage '$CORE_CONFIG_FILE'\n$@") + die ("$errormessage\n$@") } # RT::Essentials mistakenly recommends that WebPath be set to '/'. @@ -410,7 +410,9 @@ Load all modules that define base classes 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 +425,31 @@ sub InitClasses { 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 + ); } # }}} @@ -459,6 +486,8 @@ ok ($RT::SystemUser->Name() ne 'noname', "The system user isn't noname"); =cut +eval "require RT_Vendor"; +die $@ if ($@ && $@ !~ qr{^Can't locate RT_Vendor.pm}); eval "require RT_Local"; die $@ if ($@ && $@ !~ qr{^Can't locate RT_Local.pm});