[rt-users] Add value to array in RT_SiteConfig.pm

Thomas Sibley trs at bestpractical.com
Fri Apr 26 15:16:19 EDT 2013


On 04/26/2013 07:49 AM, Kevin Falcone wrote:
> On Fri, Apr 26, 2013 at 12:12:48PM +0300, Pavel Gulchouck wrote:
>> I want to add one custom script to @JSFiles, but cannot find 
>> anything like Push() or Add() in config parser, only Set().
>> Is the only way copy all predefined array from RT_Config.pm to 
>> RT_SiteConfig.pm?
> 
> For @JSFiles you have to copy (we've fixed this in the development
> series).  You also have to be careful on upgrades in case we add files
> to @JSFiles.
> 
> If you're writing a local extension, you want to use
> http://bestpractical.com/rt/docs/latest/RT.html#AddJavaScript
> from your code rather than munging the config.

You should be able to use this, somewhat hackishly but just fine, in a
local/etc/JS_Config.pm or etc/JS_Config.pm with this content:

    RT->AddJavaScript("foo.js");
    1;

You can't do that from your RT_SiteConfig.pm for load order reasons, but
you can do so from additional config files.




More information about the rt-users mailing list