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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

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: 10015
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: 10015
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: No registered users and 2 guests