Funding plugin doesn't work in OJS 3.1.0.1

Hello!

I installed the Funding plugin according to the instruction (GitHub - ajnyga/funding: Integrates Crossref Funder registry to OJS3 and OMP3), but unfortunately the message “DB Error: Table ‘ojs.funders’ doesn’t exist” appears on the article page.

Any ideas how to solve the problem?

Regards

Hi,

The plugin should be compatible with 3.1.0.1.

See the installation instructions here: funding/README.md at master · ajnyga/funding · GitHub

Note that you need to run php tools/upgrade.php upgrade. This will create the database tables which are lacking from your installation at the moment. Hope you get it working. Unfortunately installing plugins which create their own database tables is not that smooth in OJS.

Let me know if you have any feedback about the plugin!

Thank you for the answer.

I installed plugins according to the instruction (funding/README.md at master · ajnyga/funding · GitHub). I run php tools/upgrade.php upgrade, but this do not create database tables…

Best

Hi,

Did you get the release from here Releases · ajnyga/funding · GitHub or did you download a zip using the “clone or download” button in github? If the latter, then make sure that the plugin folder is named just funding and not something like funding-master.

If that is not the problem, then you could try running this
php tools/dbXMLtoSQL.php -schema execute plugins/generic/funding/schema.xml

If the plugin folder is named correctly, it is in the right place in the generic folder and even that command does not work, then I would say that there is something wrong in OJS itself. I can check the installation myself on 3.1.0.1. tomorrow (Finnish time).

Edit: one more thing comes to mind. It is of course possible that your mysql user does not have the required privileges to create tables.

I download z zip using the “clone or download” button in github, but the plugin folder is named correctly (funding) and is in the right place in generic folder.

Unfortunately that command (php tools/dbXMLtoSQL.php -schema execute plugins/generic/funding/schema.xml) does not work.

Mysqo user have all required privileges.

I checked the funding plugin on “clean” OJS 3.1.0.1 and OJS 3.1.0 installation on my locale (via XAMPP) - it does not work…

Regards

Hi,

Thanks for testing. Basically running the script against the xml file should create the tables. In fact that part has little to do with the plugin itself. But maybe there is a problem in the schema.xml file, I have to check. I will get back to you later today.

I just tested the plugin with XAMPP and the latest version of OJS 3.1.0-1.

I downloaded the latest release Releases · ajnyga/funding · GitHub
Unzipped it and moved the the funding folder under plugins/generic
After that I ran the php tools/upgrade.php upgrade and the database tables were created succesfully
I then enabled the plugin from the dashboard and it started to work.

So it seems to work with the latest OJS. I can not figure out why it won’t work for you.
@asmecher, do you have any suggestions? See the thread above.

edit: tested the installation also with our online test server which I upgraded to 3.1.0-1 a couple of days ago and it worked there as well.

Hi @ilona,

The most likely problem is that the plugin doesn’t have an entry in the versions table. This gets created by any of the following…

  • Running the upgrade script
  • Using the lib/pkp/tools/installPluginVersion.php script
  • Installing the plugin via the web-based upload tool

Regards,
Alec Smecher
Public Knowledge Project Team

@ajnyga, @asmecher

Thank you very much for the answers! What should I exactly do?

Ragards

@asmecher,
the finding plugin do have an entry in the versions table, but the plugin still does not work…

Regards

Hi @ilona,

Unfortunately that command (php tools/dbXMLtoSQL.php -schema execute plugins/generic/funding/schema.xml) does not work.

Can you describe what happened when you tried to run that command?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

when I open this file, nothing happens.

Regards

Hi @ilona,

Can you describe in more detail what you’re trying, and what the result is?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

according to the @ajnyga suggestion I run this: php tools/dbXMLtoSQL.php, that’s all. I’m doing something wrong?

Regards

Hi @ilona,

I’m just trying to figure out whether the trouble you’re having with that command is related to the problem with the plugin. You said the command “does not work” – do you get an error message or something similar?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,
I do not get any error message. I just onen that file (tools/dbXMLtoSQL.php), that’s it.

Regards

Hi @ilona,

I’m afraid I’m not following – I suppose “onen” is a typo? What exactly was the command line you executed, and what was the result? You’ve mentioned e.g…

php tools/dbXMLtoSQL.php

…but the command should be, per @ajnyga’s earlier post…

php tools/dbXMLtoSQL.php -schema execute plugins/generic/funding/schema.xml

Once you’ve executed this command, the funders table should exist in your database.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

yes, it was a typo, I mean “open”.
I guess I’m not understand where i should put this (php tools/dbXMLtoSQL.php -schema execute plugins/generic/funding/schema.xml) command. Thank you for your time, but I do not think I can not fix the problem with funding plugin.

Regards

Hi @ilona,

You’ll need to run that command on the server’s command line, from inside OJS’s installation directory.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @ilona,

Like Alec mentioned above both the php tools/upgrade.php upgrade and the other command I mentioned should be run from the command line. This is the only native way you can add plugins with database tables to OJS at the moment, so it is really not a problem with the plugin itself. (I think Alec has mentioned before that this could change in the future?)

If you open the XAMPP Control Panel, you will see a button called “Shell”. Clicking that will open the command line tool. The default folder will probably be c:\xampp. You will have to move to the OJS folder probably under htdocs. There you can run the command mentioned above. Both of them should work. However, it could be that your XAMPP is not configured to support PHP on command line. You can find instructions on how to do that online Run PHP from command line with XAMPP on Windows 7 – Mark LaDoux

With actual webservers the PHP should work from the command line by default. I connect to our server using a program named PuTTY. But it is difficult to give instructions on how to do that with your server. This is something your service provider could probably answer better.

You could of course add the database tables with mysql commands. However, if you can not run the php tools/upgrade.php upgrade command, then the plugin is maybe not registered properly. I am not sure if this will lead to other problems later on, @asmecher? But here are the needed mysql commands anyway.

CREATE TABLE `funders` (
  `funder_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `funder_identification` varchar(255) NOT NULL,
  `submission_id` bigint(20) NOT NULL,
  `context_id` bigint(20) NOT NULL,
  PRIMARY KEY (`funder_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `funder_awards` (
  `funder_award_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `funder_id` bigint(20) NOT NULL,
  `funder_award_number` varchar(255) NOT NULL,
  PRIMARY KEY (`funder_award_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `funder_award_settings` (
  `funder_award_id` bigint(20) NOT NULL,
  `locale` varchar(5) NOT NULL DEFAULT '',
  `setting_name` varchar(255) NOT NULL,
  `setting_value` text,
  `setting_type` varchar(6) NOT NULL,
  UNIQUE KEY `funder_award_settings_pkey` (`funder_award_id`,`locale`,`setting_name`),
  KEY `funder_award_settings_id` (`funder_award_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `funder_settings` (
  `funder_id` bigint(20) NOT NULL,
  `locale` varchar(5) NOT NULL DEFAULT '',
  `setting_name` varchar(255) NOT NULL,
  `setting_value` text,
  `setting_type` varchar(6) NOT NULL,
  UNIQUE KEY `funder_settings_pkey` (`funder_id`,`locale`,`setting_name`),
  KEY `funder_settings_id` (`funder_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;