OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Multiple plugins, same hook

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Multiple plugins, same hook

Postby MartinEve » Tue Sep 13, 2011 2:01 am

Hi,

I'm having some problems with multiple plugins registering for the same hook. If I enable the xmlGalley plugin, my subsequent attempt to hook ArticleGalleyDAO::insertNewGalley fails. To be clear: this works if I disable the other plugin that hooks this, but not when both are enabled. Any ideas?
MartinEve
 
Posts: 11
Joined: Sun Jul 10, 2011 6:33 am

Re: Multiple plugins, same hook

Postby asmecher » Tue Sep 13, 2011 9:12 am

Hi MartinEve,

Hooks can be chained, but the first hook callback to return a "true" will interrupt the hook call and prevent subsequent registrants from being called. Double-check to see whether or not the hook callbacks are returning true or not.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

Re: Multiple plugins, same hook

Postby MartinEve » Tue Sep 13, 2011 12:38 pm

Hi Alec,

Hmmm, in that case, I'm pretty sure that's what's happening. Isn't that a bit of a design flaw?

Best,

Martin
MartinEve
 
Posts: 11
Joined: Sun Jul 10, 2011 6:33 am

Re: Multiple plugins, same hook

Postby asmecher » Tue Sep 13, 2011 1:54 pm

Hi Martin,

There are some known problems with the XML galleys plugin, unfortunately, and it is in need of some rewriting. It's not widely used, so we haven't been able to prioritize it for attention yet.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7710
Joined: Wed Aug 10, 2005 12:56 pm

Re: Multiple plugins, same hook

Postby MartinEve » Tue Sep 13, 2011 10:32 pm

Thanks again for the reply. In that case, I'll have a look at doing some work on the plugin myself; will keep you posted on progress :)
MartinEve
 
Posts: 11
Joined: Sun Jul 10, 2011 6:33 am


Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest