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

PHP Fatal error: Uncaught Error: Call to undefined method SubmissionFile::getFilePath() #15

Closed
marcoblancas opened this issue Feb 4, 2021 · 3 comments

Comments

@marcoblancas
Copy link

With OJS 3.3.0.2 and oaiJats 1.0.4.0 I get this error when I request jats via oai interface

[Thu Feb 04 20:00:20.634284 2021] [php7:error] [pid 9671] [client 127.0.0.1:49486] PHP Fatal error: Uncaught Error: Call to undefined method SubmissionFile::getFilePath() in /home/isaac.marco/git/ojs33/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php:65
Stack trace:
#0 /home/isaac.marco/git/ojs33/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php(91): OAIMetadataFormat_JATS->_findJats(Object(OAIRecord))
#1 /home/isaac.marco/git/ojs33/lib/pkp/classes/oai/OAI.inc.php(788): OAIMetadataFormat_JATS->toXml(Object(OAIRecord))
#2 /home/isaac.marco/git/ojs33/lib/pkp/classes/oai/OAI.inc.php(244): OAI->formatMetadata('jats', Object(OAIRecord))
#3 /home/isaac.marco/git/ojs33/lib/pkp/classes/oai/OAI.inc.php(73): OAI->GetRecord()
#4 /home/isaac.marco/git/ojs33/pages/oai/OAIHandler.inc.php(39): OAI->execute()
#5 /home/isaac.marco/git/ojs33/lib/pkp/classes/core/PKPRouter.inc.php(395): OAIHandler->index(Array, Object(Request))
#6 /home/isaac.marco/git/ojs33/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#7 / in /home/isaac.marco/git/ojs33/plugins/oaiMetadataFormats/oaiJats/OAIMetadataFormat_JATS.inc.php on line 65

Steps to reproduce:

  1. Install a clean OJS 3.3.0.2
  2. Create an issue and a submision just with one pdf in galley (no xml file) and plubish.
  3. Install and enable oaiJats 1.0.4.0
  4. Request oai information with url http://loc.ojs33/index.php/cero/oai?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:oai.loc.ojs33:article/1
  5. Verify you get information.
  6. Replace in this url metadataPrefix=oai_dc by metadataPrefix=jats . http://loc.ojs33/index.php/cero/oai?verb=GetRecord&metadataPrefix=jats&identifier=oai:oai.loc.ojs33:article/1
  7. Verify you receive an oai error "Error Code | cannotDisseminateFormat | Cannot disseminate format (JATS XML not available". This error is OK because we don't have xml jats in galley.
  8. Upload a valid xml jats in galley to to a new revision in the same issue an publish.
  9. Repeat the request. http://loc.ojs33/index.php/cero/oai?verb=GetRecord&metadataPrefix=jats&identifier=oai:oai.loc.ojs33:article/1
  10. Verify you get a blank page in your browser (error 500) and in the apache log the error I paste on top

What was expected

This is what I was expecting:

2021-02-04_20-26

I'm not sure if this is an error but until today I used to verify my exposed xml jats in this way and now it is failing. If this is the same way index services use to get jats metadata I suppose they will get the same error but I'm not an expert in OAI interface.

Regards.

asmecher added a commit that referenced this issue Feb 4, 2021
asmecher added a commit that referenced this issue Feb 4, 2021
@asmecher
Copy link
Member

asmecher commented Feb 4, 2021

@marcoblancas, you should be able to fix this by applying either of the above commits to your oaiJats plugin (they're equivalent, just applied to different branches). I'll release a new version of that plugin shortly, so it should appear in the Plugin Gallery. (Edit: Fix released in 1.0.4-2.)

@asmecher asmecher closed this as completed Feb 4, 2021
@asmecher
Copy link
Member

asmecher commented Feb 4, 2021

Thanks for the detailed report!

@marcoblancas
Copy link
Author

Great. Now it's working as I was expecting.

Thank you very much. You have been really quick.

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

2 participants