![]() |
Plugin conflict: template hooks break when I use $templater = vB_Template::create();
I'm having a strange error where calling $templater = vB_Template::create(); in a plugin causes other plugins that utilize template hooks to break.
here is the plugin that calls $templater = vB_Template::create(); product: vBulletin hook location: global_start execution order: 5 PHP Code:
product: atdtwt hook location: showthread_start (also tried global_start) execution order: 5 (also tried 4 and 10) I also tried using diffrent template hooks (head PHP Code:
PHP Code:
PHP Code:
|
Change the second (broken) plugin to use hook parse_templates. Your use of a template in global_start causes the 'standard' templates (including headinclude) to be rendered, so by the time execution reaches showthread_start it's too late to set a template hook.
Edit: you may also have to enclose the code in that second template in if (THIS_SCRIPT == 'showthread') { /* code here */ } otherwise it will be on every page. |
Just to add that global_start is also deprecated. People need to start paying attention to that because it could disappear at any time (it's been two years since it was deprecated).
|
Quote:
Edit: I changed the broken plugin to kh99's suggestion and the template plugins to fire at global_bootstrap_init_start and that seemed to have solved it. The plugin works correctly in my custom skin and the default now. Thanks. product: atdtwt hook location: parse_templates execution order: 5 PHP Code:
|
Quote:
|
One more minor thing, changing to global_bootstrap_init_start seems to have removed the titles 'Quick Style Chooser', 'Standard Styles', and 'Mobile Styles' from my quick style chooser? Am I causing another conflict?
|
I don't know why that is, but my guess is that global_bootstrap_init_start may be called too early for what your plugin is doing.
Edit: have you tried global_bootstrap_complete? |
That did it, all is well, thanks a lot everyone.
|
All times are GMT. The time now is 09:13 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|