From 4e43da6dff682295e4e0b2fbdd7097fce95c68d7 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 28 Aug 2012 01:20:13 -0700 Subject: [PATCH] prevent the "prepared statement "dbdpg_pN_N" already exists" errors that result in "Cant call method "HasRight" on an undefined value" errors, RT#19104 --- htetc/handler.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htetc/handler.pl b/htetc/handler.pl index d7c56572c..3c68e83ed 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -8,10 +8,19 @@ use FS::Mason qw( mason_interps ); use FS::Trace; if ( %%%RT_ENABLED%%% ) { + require RT; + $> = scalar(getpwnam('freeside')); + RT::LoadConfig(); RT::Init(); + + # disconnect DB before fork: + # (avoid 'prepared statement "dbdpg_p\d+_\d+" already exists' errors?) + $RT::Handle->dbh(undef); + undef $RT::Handle; + $> = $<; } -- 2.11.0