Hi
I’m in the process of writing a plugin for our OJS but the callback method is never called.
I made sure that the plugin is activated. Also put an error_log(...)
inside the register method to verify that everything worked fine.
Goal of the plugin is to show something on the backend side inside the submission tab.
For this I thought I can register my own hook which I then call from the OJS submission.tpl
template file via {call_hook name=...}
.
After this did not work I tried with a very generic hook just so I can see if the plugin works at all but even
on the common footer (on the public frontend side) there is no output and the callback is never actually called.
HookRegistry::register('Templates::Admin::Submission::Step1', array($this, 'actionCallback'));
HookRegistry::register('Templates::Common::Footer::PageFooter', array($this, 'actionCallback'));
I then went inside the hook OJS magic and found out that the hook is from the template is successfully calling method smartyCallHook inside ./lib/pkp/classes/template/PKPTemplateManager.inc.php
.
Then I proceeded to check for the call method inside the HookRegistry itself and added some debug error_log(...)
statements there.
Long story short:
if (!isset($hooks[$hookName])) { }
This if triggers for both of my hooks.
Did I understood something entirely wrong about the hook concept?
Maybe one of you can help me out.
Many thanks in advance