Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin can't find version.xml during upgrade #2

Open
jnugent opened this issue Jan 17, 2019 · 7 comments
Open

Plugin can't find version.xml during upgrade #2

jnugent opened this issue Jan 17, 2019 · 7 comments

Comments

@jnugent
Copy link
Member

jnugent commented Jan 17, 2019

On a PKP|PS journal, the sword plugin is installed. However, during an upgrade from 3.1.1-2 to 3.1.1-4 I noticed that the CLI upgrade process was failing during the [code: Installer Installer::addPluginVersions] section, with:

You are trying to downgrade the product "" from version [3.1.1.2] to version [1.0.0.0]. Downgrades are not supported.

ojs2: You are trying to downgrade the product "" from version [3.1.1.2] to version [1.0.0.0]. Downgrades are not supported.

It appears that the getPluginPath() method for Sword returns an empty string, which means that Installer::addPluginVersions() builds a path to the version.xml file that ends up being "/version.xml"

$versionFile = $plugin->getPluginPath() . '/version.xml';

Removing the sword plugin directory and removing the old entries from the versions table related to it allows the upgrade to proceed to completion.

@asmecher
Copy link
Member

@jnugent, is the plugins/generic/sword directory present/populated in the ojs-stable-3_1_1 codebase for that install? It shouldn't be -- see https://github.com/pkp/ojs/tree/ojs-stable-3_1_1/plugins/generic. Or was it installed from this repo separately?

@jnugent
Copy link
Member Author

jnugent commented Jan 29, 2019

@asmecher - it had been previously installed from the repository. Looking at the journal now, there's a .gitmodules file in the directory pointing to https://github.com/swordapp/swordappv2-php-library. The upgrade procedure would have been to bring the rest of the repository up to ojs-stable-3_1_1, update the sub modules, and then run the regular upgrade CLI command.

@asmecher
Copy link
Member

Can you try to narrow down why getPluginPath would be returning a blank? I can't think of a good reason that would be happening.

@kaitlinnewson
Copy link
Member

Hey @asmecher, wanted to let you know that we've also been running into this issue, and removing the sword plugin has allowed us to run the upgrade script successfully.

@jnugent
Copy link
Member Author

jnugent commented Feb 8, 2019

Hey @kaitlinnewson - I'm trying to find some time to investigate this further, also.

@nils-stefan-weiher
Copy link

@jnugent
@asmecher
I still have this issue with OJS 3.1.2-1 upgrading from 3.1.1
The problem is the child SwordImportExportPlugin class, which the SwordPlugin registers through a callback triggered by PluginRegistry::loadCategory.
The installer tries to load a version file for the SwordImportExportPlugin, because it was loaded by PluginRegistry::loadCategory.

The SwordImportExportPlugin class is missing the method for getPluginPath(), and so no path is returned, it should return the path of the parent method.

Will try to fix this and test locally and then open a PR.

@asmecher
Copy link
Member

@isgrim, sounds like you've tracked down a tricky one!

nils-stefan-weiher added a commit to UB-Heidelberg/sword that referenced this issue Nov 26, 2019
asmecher pushed a commit that referenced this issue Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants