[rt-users] undef settings in RT_SiteConfig

Stephen Turner sturner at MIT.EDU
Thu Jan 29 15:12:12 EST 2004


Hello,

What is the correct way to "turn off" a setting in RT_SiteConfig.pm?

I assumed from the sample RT_Config.pm that setting a variable to
undef would do this. But... if you have this:

RT_SiteConfig.pm               Set($LogToSysLog , undef)
RT_Config.pm                      Set($LogToSysLog , 'debug')

Then the setting in RT_Config.pm wins out, and LogToSysLog
is set to 'debug' rather than being turned off. This appears to because
of this code in RT.pm:

    local *Set = sub { $_[0] = $_[1] unless defined $_[0] };

[ in this case $_[0] is the site-config setting (undef) and $_[1] is the
core-config setting ('debug' ) ]

The way to turn off LogToSysLog in SiteConfig is therefore:

   Set($LogToSysLog , 0)

This may be a feature rather than a bug, but I don't think it's obvious  - the
behavior has the apparent effect allowing Config to override settings in
SiteConfig.

Maybe a simple note in the sample config file to use 0 rather than undef to
turn off settings might clarify things.

Steve




More information about the rt-users mailing list