The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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:
|
#2
|
|||
|
|||
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. |
#3
|
||||
|
||||
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).
|
2 благодарности(ей) от: | ||
DetroitYES, Diggo11 |
#4
|
||||
|
||||
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:
|
#5
|
|||
|
|||
I don't think that's true. parse_templates is always called just before the header, headinclude, headinclude_bottom, and footer templates are rendered, so I believe that's the correct hook to use for a plugin that wants to add to one of those templates. In fact, if the goal of your new plugin is to add to one of those templates then you'd probably want to use that hook as well.
|
Благодарность от: | ||
Diggo11 |
#6
|
||||
|
||||
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?
|
#7
|
|||
|
|||
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? |
Благодарность от: | ||
DetroitYES |
#8
|
||||
|
||||
That did it, all is well, thanks a lot everyone.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|