Plugin settings and schema

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

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

Forum rules
The Public Knowledge Project Support Forum is moving to

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.
Posts: 2
Joined: Fri May 11, 2012 5:24 am

Plugin settings and schema

Postby nasosi » Fri May 11, 2012 6:15 am

Dear all,
Since I am new to OJS and php I hope that you forgive my incidental ignorance on certain matters.

I am trying to develop a fairly simple plugin, that requires a table ( database entries) and some default plugin settings separate from that table to start with. I have followed the guidelines on the example plugin in the documentation ( Link) and have looked in the source code of various plugins to figure out how to accomplish it, but I don't seem to be able to set it up correctly.

Specifically, when I install my .tar.gz from the web interface, everything uploads correctly, the plugin appears in the generic plugins, it can be enabled and its settings can be accessed manipulated and saved. The problems I have though are:

    1. The default settings appearing in the settings.xml do not make it in the settings form.
    2. The schema.xml definition doesn't make it into the database (I cannot see the table I defined using phpmyadmin).

Looking at the apache error log I only see the following wanring:
[Fri May 11 08:33:07 2012] [error] [client] ojs2 has produced an error\n Message: WARNING: Missing argument 1 for PaymentManager::PaymentManager(), called in /var/www/ojs_exp/classes/payment/ojs/ on line 35 and defined\n In file: /var/www/ojs_exp/lib/pkp/classes/payment/\n At line: 22\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 5.3.10-1ubuntu3.1\n Apache Version: Apache/2.2.22 (Ubuntu)\n DB Driver: mysql\n DB server version: 5.5.22-0ubuntu1, referer: ... ns/install

that doesn't to be related to the problems I have since when I alter the definition of the constructor in, the warning disappears, but the settings.xml and schema.xml still don't make it in OJS (after removal and re-installation to a newer version of the plugin).

Attached please find a cut down version that demonstates what I have built up to now. I am using ojs 2.3.7 on an ubuntu 12.04 server.

Looking forward for any help.

Best regards,
Cut down version of a sample plugin
(2.34 KiB) Downloaded 22 times

Posts: 945
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Plugin settings and schema

Postby ramon » Sun May 13, 2012 8:51 pm

Hello Nasos,

I believe that for plugins that require installing database tables, you need to execute (via command-line) php tools/upgrade.php upgrade
This will cause your XML file to be executed, installing the data structure, but I may be wrong.
Please, test this first before running on a production environment, and ALWAYS make a full backup prior to this.

Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT

Site Admin
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Re: Plugin settings and schema

Postby JasonNugent » Mon May 14, 2012 3:02 am

Hi nasosi,

Plugins that require database tables should include a schema.xml file that describes the required schema changes. This file is loaded automatically when either the upgrade.php script is run (as Ramon mentioned), or when the plugin is installed via the web interface. For an example of such a plugin, have a look at the externalFeed plugin, located in the plugins/generic/ directory.

(and yes, it's always a good idea to have a recent backup when doing things that modify the database).


PS: Also, you can ignore the PaymentManager() warnings. It's an argument mismatch in the constructor, and is purely cosmetic.

Posts: 2
Joined: Fri May 11, 2012 5:24 am

Re: Plugin settings and schema

Postby nasosi » Mon May 14, 2012 12:43 pm

Hi again,
Thank you very much for your answers. I tried the suggestion but unfortunately it did not work.

After a lot of search it turns out that the schema.xml is not what the installer expects. According to this discussion (Link) there should be an intermediate file (install.xml) that references schema.xml. I tested those suggestions and they work. Nevertheless It seems that the issues raised in this report are not fully dealt with, or It has turned out really hard for me to find any proper documentation on-line that suggests otherwise.

I am still struggling with the settings.xml :(


Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest