Replacing functions

Hi,

In RT2 we used to override the LookupExternalUserInfo in the

config file. I read about RT3 doing it in a _Local file, but I
see things on Google with people putting in User_Local.pm . Shouldn’t
it go in EmailParser_Local.pm? And does it go into my $RT/etc/
directory or the $RT/lib/RT directory?

(FreeBSD ports install)

	Thanks, Tuc

http://wiki.bestpractical.com/view/CleanlyCustomizeRT
read about overlays and local dirOn Feb 5, 2008 11:13 PM, Tuc at T-B-O-H ml@t-b-o-h.net wrote:

Hi,

    In RT2 we used to override the LookupExternalUserInfo in the

config file. I read about RT3 doing it in a _Local file, but I
see things on Google with people putting in User_Local.pm . Shouldn’t
it go in EmailParser_Local.pm? And does it go into my $RT/etc/
directory or the $RT/lib/RT directory?

    (FreeBSD ports install)

            Thanks, Tuc

The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

Hi,

I saw that, but the original file isn't in a XXX_Overlay.pm file 

currently. Does that not make it eligible for overlay/local? I’d rather
not use the local dir and overwrite the entire module, just the
LookupExternalUserInfo function.

	Thanks, Tuc

In the bottom of main .pm file you can find something like:
eval “require RT::EmailParser_Vendor”;
die $@ if ($@ && $@ !~ qr{^Can’t locate RT/EmailParser_Vendor.pm});
eval “require RT::EmailParser_Local”;
die $@ if ($@ && $@ !~ qr{^Can’t locate RT/EmailParser_Local.pm});

Such code loads matching _Vendor.pm and _Local.pm files. So you can
use local/lib/RT/EmailParser_Local.pm to override that function.
_Overlay.pm we use only where main .pm file is auto-generated by a
tool, but that doesn’t mean you can not use _Local.pm files for those
without overlay.pm.

You can use the following command to test that:
find lib/ -type f -name ‘.pm’ | xargs grep -lP 'require\s._Local’

Please, update the wiki with this info so next time people will get
everything right without asking.On Feb 6, 2008 9:39 PM, Tuc at T-B-O-H ml@t-b-o-h.net wrote:

Hi,

    I saw that, but the original file isn't in a XXX_Overlay.pm file

currently. Does that not make it eligible for overlay/local? I’d rather
not use the local dir and overwrite the entire module, just the
LookupExternalUserInfo function.

            Thanks, Tuc

CleanlyCustomizeRT - Request Tracker Wiki
read about overlays and local dir

On Feb 5, 2008 11:13 PM, Tuc at T-B-O-H ml@t-b-o-h.net wrote:

Hi,

    In RT2 we used to override the LookupExternalUserInfo in the

config file. I read about RT3 doing it in a _Local file, but I
see things on Google with people putting in User_Local.pm . Shouldn’t
it go in EmailParser_Local.pm? And does it go into my $RT/etc/
directory or the $RT/lib/RT directory?

    (FreeBSD ports install)

            Thanks, Tuc

The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

Hi,

Understood, thank you. 

Yes, the wiki didn't seem to indicate that. I only saw

“The real RT code is in XXX_Overlay.pm.”. Since the EmailParser.pm
doesn’t have a _Overlay, I wasn’t sure it was eligible for it.

That xargs doesn't work on my FreeBSD, but I'll figure

that out myself.

Thanks again.

		Tuc

Please, update the wiki with this info so next time people will get
everything right without asking.

Also would be good to mention that when they do, and reload

apache, they’ll see if it took or not by something like :

Subroutine LookupExternalUserInfo redefined at /usr/local/rt3/lib/RT/EmailParser_Local.pm line 45

	Tuc