Hi All,
I have noticed a slight problem with the "full clone" feature of hosts/templates. When cloning, the triggers are duplicated properly, however their dependencies are not. For instance, if I have the following triggers in HOST1: (number in brackets is the trigger ID)
And then full-clone HOST1 -> HOST2, the triggers will look like this:
instead of:
as it should be. In essence, the cloned template's triggers which have dependencies will still depend on the triggers from the souce template.
I urgently needed to be able to properly clone a few templates which have a moderate number of triggers with many interdependencies, so I created the following patch to fix the problem (attached).
DISCLAIMER: I have not fully tested this patch. I have not checked to see if updating the corresponding C code is necessary. If you chose to use this patch, it is at your own risk. In order words, to quote the GPL:
Enjoy!
I have noticed a slight problem with the "full clone" feature of hosts/templates. When cloning, the triggers are duplicated properly, however their dependencies are not. For instance, if I have the following triggers in HOST1: (number in brackets is the trigger ID)
Code:
HOST1:Trigger A (1)
Dep: HOST1:Trigger B (2)
HOST1:Trigger B (2)
Code:
HOST2:Trigger A (3)
Dep: HOST1:Trigger B (2)
HOST2:Trigger B (4)
Code:
HOST2:Trigger A (3)
Dep: HOST[B]2[/B]:Trigger B ([B]4[/B])
HOST2:Trigger B (4)
I urgently needed to be able to properly clone a few templates which have a moderate number of triggers with many interdependencies, so I created the following patch to fix the problem (attached).
DISCLAIMER: I have not fully tested this patch. I have not checked to see if updating the corresponding C code is necessary. If you chose to use this patch, it is at your own risk. In order words, to quote the GPL:
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Comment