OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Plugins for OJS 2.2

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.

Plugins for OJS 2.2

Postby christo » Thu Jan 24, 2008 4:30 am

Hi

We have a number of plugins which are working on OJS 2.1

However, when we add them to our OSJ 2.2 installation we get a 'Cannot redeclare class' error.
The error occurs for the last line of the plugin.

for example in the code:

Code: Select all
1: import('classes.plugins.GenericPlugin');
2:
3: class MyPlugin extends GenericPlugin {
...
n: }


The error will be reported for line n:
Is this a known issue? and do you have any idea of what might be causing it?
christo
 
Posts: 22
Joined: Mon Jan 09, 2006 12:04 am
Location: Grahamstown, South Africa

Re: Plugins for OJS 2.2

Postby christo » Thu Jan 24, 2008 4:35 am

More information which might be useful; the call stack:
Code: Select all
#   Time   Memory   Function   Location
1   0.0011   79152   {main}( )   ..(null):0
2   0.3993   7365880   handleRequest( )   ..(null):69
3   0.4037   7617128   call_user_func ( )   ..(null):58
4   0.4037   7617128   ManagerHandler::plugins( )   ..(null):0
5   0.4049   7657152   PluginHandler::plugins( )   ..(null):507
6   0.4101   7809056   PluginRegistry::loadCategory( )   ..(null):36
7   0.4750   7813144   include( 'D:\web\wamp\www\ojs-2.2\plugins\generic\xmlMachine\index.php' )   ..(null):100


As you can see the error occurs in the index stub file, but before the line
Code: Select all
return new MyPlugin();

- so the error is in the included plugin file...which is strange - because it is not actually even being instantiated at this stage:
christo
 
Posts: 22
Joined: Mon Jan 09, 2006 12:04 am
Location: Grahamstown, South Africa

Re: Plugins for OJS 2.2

Postby smiri » Thu Jan 24, 2008 4:35 pm

Hi christo,

There has been some major changes in OJS 2.2 code and that would mean OJS 2.1 plugins are not compatible with OJS 2.2. You would have to use OJS 2.2 plugins with version 2.2.

Regards,
smiri
 
Posts: 183
Joined: Thu Sep 06, 2007 7:01 pm

Re: Plugins for OJS 2.2

Postby christo » Thu Jan 24, 2008 11:28 pm

Ok. But these are custom plugins which we have developed in-house in order to get necessary functionality out of OJS.

Even more ironically; the reason we chose to make modifications via plugins was so that we could upgrade seamlessly as OJS evolves. We have painstakingly avoided any modification of core OJS code so as to enable our installation to upgrade without issue to future versions of OJS. It is of some concern that backward compatibility is not maintained even between minor versions (2.1 - 2.2).

What are the differences between plugin implementations in 2.1 and 2.2 and what would be involved in porting our plugins to 2.2?
christo
 
Posts: 22
Joined: Mon Jan 09, 2006 12:04 am
Location: Grahamstown, South Africa

Re: Plugins for OJS 2.2

Postby asmecher » Thu Jan 24, 2008 11:29 pm

Hi Christo,

The problem is in the index.php wrapper -- try changing the "require" call into "require_once". This is a safe change to make for all your plugins.

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


Return to OJS Development

Who is online

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