Adding options to an Configuration Array

English! place to talk about development, programming and coding
Post Reply
seberget2
Znuny newbie
Posts: 74
Joined: 17 May 2013, 09:30
Znuny Version: 6.0.30
Real Name: Stein Erik Berget

Adding options to an Configuration Array

Post by seberget2 »

I'm trying to add configuration options to the email headers that are to be scanned. I've tried this:

Code: Select all

    <ConfigItem Name="PostmasterX-Header" Required="1" Valid="1">
        <Description Translatable="1">Defines all the X-headers that should be scanned.</Description>
        <Group>Ticket</Group>
        <SubGroup>Core::PostMaster</SubGroup>
        <Setting>
            <Array>
                <Item>X-my-header</Item>
            </Array>
        </Setting>
    </ConfigItem>
But this is ignored. I've also played around with

Code: Select all

<otrs_config version="1.0" init="Changes">
But this also fails. I've had a look at http://otrs.github.io/doc/manual/develo ... xml-config but that does not give any good answer to my challenge.

I would like to add this, because a module I'm developing needs to add a few entries here, and I would like to do it while the module is installed...

Have a happy evening/night!
OTRS 6.0.12 on Ubuntu with MySQL DB, and various plug-ins and a hack or two :-D
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Adding options to an Configuration Array

Post by reneeb »

Generally: To override an existing config option from the framework, you should copy the config_item to you own xml and make your changes. Be aware that that overrides the original option and does *not* add anything. You have to ensure that your .xml is loaded *after* the .xml with the original option. If you have already changed the config option via sysconfig, those changes will still be shown in SysConfig.

I assume it's for the Out-Of-Office package you uploaded to OPAR. Here you have an other challenge: You can't know if the OTRS-admin who wants to install that package has already changed the sysconfig. So you can't just override the option. You have to change the config option during package installation (similar to what I do here: https://github.com/reneeb/otrs_uebungen ... ds.pm#L336 ).
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
seberget2
Znuny newbie
Posts: 74
Joined: 17 May 2013, 09:30
Znuny Version: 6.0.30
Real Name: Stein Erik Berget

Re: Adding options to an Configuration Array

Post by seberget2 »

reneeb wrote:I assume it's for the Out-Of-Office package you uploaded to OPAR. Here you have an other challenge: You can't know if the OTRS-admin who wants to install that package has already changed the sysconfig. So you can't just override the option. You have to change the config option during package installation (similar to what I do here: https://github.com/reneeb/otrs_uebungen ... ds.pm#L336 ).
Thank you a lot, this gives me new ideas. Thank you. I'll test this out. Hope you are OK if I ask you some questions regarding this when I've looked at it :-)
OTRS 6.0.12 on Ubuntu with MySQL DB, and various plug-ins and a hack or two :-D
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Adding options to an Configuration Array

Post by reneeb »

seberget2 wrote:Hope you are OK if I ask you some questions regarding this when I've looked at it :-)
Sure... Please do so.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply