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

NativeImportExportPlugin over web works, but over CLI fatal: Invalid XML #8054

Closed
ErikI1 opened this issue Jun 30, 2022 · 7 comments
Closed
Assignees

Comments

@ErikI1
Copy link

ErikI1 commented Jun 30, 2022

Describe the bug
export over NativeImportExportPlugin is working, but not over cli (from 9 exports of issue only 2 was successful) :

php ./tools/importExport.php NativeImportExportPlugin export /tmp/test.xml phat issue 31

`Validation errors:
Element '{http://pkp.sfu.ca}issues': Missing child element(s). Expected is ( {http://pkp.sfu.ca}issue ).
Invalid XML:

PHP Fatal error: Uncaught Exception: Could not convert selected objects. in /opt/ojs/ojs-3.3.0-11/lib/pkp/classes/plugins/ImportExportPlugin.inc.php:181
Stack trace:
#0 /opt/ojs/ojs-3.3.0-11/plugins/importexport/native/NativeImportExportPlugin.inc.php(294): ImportExportPlugin->displayXMLValidationErrors()
#1 /opt/ojs/ojs-3.3.0-11/plugins/importexport/native/NativeImportExportPlugin.inc.php(462): NativeImportExportPlugin->exportIssues()
#2 /opt/ojs/ojs-3.3.0-11/tools/importExport.php(63): NativeImportExportPlugin->executeCLI()
#3 /opt/ojs/ojs-3.3.0-11/tools/importExport.php(69): importExport->execute()
#4 {main}
thrown in /opt/ojs/ojs-3.3.0-11/lib/pkp/classes/plugins/ImportExportPlugin.inc.php on line 181
`

To Reproduce
Steps to reproduce the behavior:

  1. download export from https://drive.google.com/file/d/1Fl4IW2d7_8PmD75qbP5IOarBoNK-luCJ/view?usp=sharing
  2. try import a export over cli

What application are you using?
ojs-3.3.0-11
php 7.4

@asmecher
Copy link
Member

asmecher commented Jul 6, 2022

@defstat, could you take a look at this issue?

@defstat
Copy link
Contributor

defstat commented Jul 8, 2022

Hi @ErikI1, thanks for reporting that. I have two questions to start working on it:

  1. Is your problem Importing the data, or exporting the data. I am asking because you write

export over NativeImportExportPlugin is working, but not over cli

but then in the steps to reproduce you

try import a export over cli

  1. I tried to import the provided exported XML file to my dev installation (stable_3.3.0 branch) and it was successfully imported. I used the following command to import php ./tools/importExport.php NativeImportExportPlugin import .\tmp-dev\test.xml test admin issue 31. Could it be problems regarding the filter_groups table of your installation? Could you try, on a dev installation, if you have one, to run the php ./tools/upgade.php upgrade, and try to import again? (although if that was the case, you would have problems with both Web Import/Export and CLI Import/Export)

image

@ErikI1
Copy link
Author

ErikI1 commented Jul 11, 2022

Hi, thank you for your time.

  1. problem is with export over cli (it would be better if I put the command in quotation marks)
  2. www-data@e538414921e9:/opt/ojs/app$ php ./tools/upgrade.php check
    Code version: 3.3.0.11
    Database version: 3.3.0.11
    Latest version: 3.3.0.11
    Your system is up-to-date

I apologize for my English and misunderstanding.

@defstat
Copy link
Contributor

defstat commented Jul 18, 2022

Hi @ErikI1.. Thanks for the feedback.

I tried to reproduce the problem by using the stable_3.3.0 branch but I couldn't. The file that was exported can be found here

Could you please export your filter_groups table from your Batabase? I believe that the problem may be there.

@ErikI1
Copy link
Author

ErikI1 commented Jul 19, 2022

@defstat
Copy link
Contributor

defstat commented Jul 19, 2022

Hi @ErikI1.. Thanks for the reply. I don't see any issues there either. I downloaded and installed OJS 3.3.0-11 LTS (.tar.gz) locally and imported the initially given exported file.

Then I exported the file by using the CLI command, and it was exported with no problems. So I can't reproduce the issue neither on the stable-3.3.0 branch nor on the OJS 3.3.0-11 release.

Could it be that the issue you are trying to export has a different ID than the given one (not 31 in your DB)

@ErikI1
Copy link
Author

ErikI1 commented Jul 19, 2022

Of course you are right, the problem was between the chair and the keyboard. ID of issues are not the same as ID in DB, although it is possible to consider whether it could be so. Thank you very much for your help and your time.

@ErikI1 ErikI1 closed this as completed Jul 19, 2022
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