ojsde / dnb

OJS plugin that exports full texts and metadata to the Deutsche Nationalbibliothek (DNB)
GNU General Public License v2.0
3 stars 3 forks source link

Call to undefined method Submission::getAccessStatus() #25

Closed bbx-github closed 3 months ago

bbx-github commented 3 months ago

Hi there,

unfortunately I get this error:

Stack trace:
#0 /var/www/mydomain/htdocs/lib/pkp/classes/filter/Filter.inc.php(449): DNBXmlFilter->process(Object(ArticleGalley))
#1 /var/www/mydomain/htdocs/classes/plugins/PubObjectsExportPlugin.inc.php(391): Filter->execute(Object(ArticleGalley), true)
#2 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(906): PubObjectsExportPlugin->exportXML(Object(ArticleGalley), 'galley=>dnb-xml', Object(Journal), true)
#3 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(766): DNBExportPlugin->getGalleyPackage(Object(ArticleGalley), Array, 'galley=>dnb-xml', true, Object(Journal), 'dnb/1-20240826-...', '', 2126)
#4 /var/www/mydomain/htdocs/classes/plugins/PubObjectsExportPlugin.inc.php(171): DNBExportPlugin->executeExportAction(Object(Request), Array, 'galley=>dnb-xml', 'exportSubmissio...', 'articles', true)
#5 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(201): PubObjectsExportPlugin->display(Array, Object(Request))
#6 /var/www/mydomain/htdocs/lib/pkp/pages/management/PKPToolsHandler.inc.php(94): DNBExportPlugin->display(Array, Object(Request))
#7 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPRouter.inc.php(397): PKPToolsHandler->importexport(Array, Object(Request))
#8 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#9 /var/www/mydomain/htdocs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route(Object(Request))
#10 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch(Object(Request))
#11 /var/www/mydomain/htdocs/index.php(68): PKPApplication->execute()
#12 {main}
  thrown in /var/www/mydomain/htdocs/plugins/importexport/dnb/filter/DNBXmlFilter.inc.php on line 128

I searched for Submission::getAccessStatus() but only found Issue::getAccessStatus().

Versions:

So this is an error in the plugin and not in my configuration?

callmeahmedr commented 3 months ago

It's a classic case of "Missing Method" as the method Submission::getAccessStatus() is missing.

Plus this repo is not being maintained as you can clearly see in the commit history, most recent commit was 4 years ago, your safest bet is to look for another plugin at this point

ronste commented 3 months ago

Hi @bbx-github ,

could you please also copy the exact error message. It may procide some additional hints. You only copied the stack trace.

I will have a look at the issue the next days.

Hi there,

unfortunately I get this error:

Stack trace:
#0 /var/www/mydomain/htdocs/lib/pkp/classes/filter/Filter.inc.php(449): DNBXmlFilter->process(Object(ArticleGalley))
#1 /var/www/mydomain/htdocs/classes/plugins/PubObjectsExportPlugin.inc.php(391): Filter->execute(Object(ArticleGalley), true)
#2 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(906): PubObjectsExportPlugin->exportXML(Object(ArticleGalley), 'galley=>dnb-xml', Object(Journal), true)
#3 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(766): DNBExportPlugin->getGalleyPackage(Object(ArticleGalley), Array, 'galley=>dnb-xml', true, Object(Journal), 'dnb/1-20240826-...', '', 2126)
#4 /var/www/mydomain/htdocs/classes/plugins/PubObjectsExportPlugin.inc.php(171): DNBExportPlugin->executeExportAction(Object(Request), Array, 'galley=>dnb-xml', 'exportSubmissio...', 'articles', true)
#5 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(201): PubObjectsExportPlugin->display(Array, Object(Request))
#6 /var/www/mydomain/htdocs/lib/pkp/pages/management/PKPToolsHandler.inc.php(94): DNBExportPlugin->display(Array, Object(Request))
#7 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPRouter.inc.php(397): PKPToolsHandler->importexport(Array, Object(Request))
#8 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#9 /var/www/mydomain/htdocs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route(Object(Request))
#10 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch(Object(Request))
#11 /var/www/mydomain/htdocs/index.php(68): PKPApplication->execute()
#12 {main}
  thrown in /var/www/mydomain/htdocs/plugins/importexport/dnb/filter/DNBXmlFilter.inc.php on line 128

I searched for Submission::getAccessStatus() but only found Issue::getAccessStatus().

Versions:

* `ojs-3.3.0-18` + `ojs-3.3.0-19`

* `dnb-1.5.0`

So this is an error in the plugin and not in my configuration?

ronste commented 3 months ago

Hi @callmeahmedr ,

an interesting conclusion that I have to reject. And as an additional information: there are no other plugins for this purpose.

It's a classic case of "Missing Method" as the method Submission::getAccessStatus() is missing.

Plus this repo is not being maintained as you can clearly see in the commit history, most recent commit was 4 years ago, your safest bet is to look for another plugin at this point

callmeahmedr commented 3 months ago

Oops! just noticed that you still are active @ronste my bad šŸ˜‚

Hi @callmeahmedr ,

an interesting conclusion that I have to reject. And as an additional information: there are no other plugins for this purpose.

It's a classic case of "Missing Method" as the method Submission::getAccessStatus() is missing. Plus this repo is not being maintained as you can clearly see in the commit history, most recent commit was 4 years ago, your safest bet is to look for another plugin at this point

ronste commented 3 months ago

Hi @bbx-github ,

I had a very brief look at it. I suspect if you change line

https://github.com/ojsde/dnb/blob/8c4db8b492172a7fd3e957d709bed35a2aa2925c/filter/DNBXmlFilter.inc.php#L128

to

if ($submission->getCurrentPublication()->getData('accessStatus') == ARTICLE_ACCESS_OPEN) {

it will work.

Unfortunately today I am not able to test it. Will do a test tomorrow.

Hi @bbx-github ,

could you please also copy the exact error message. It may procide some additional hints. You only copied the stack trace.

I will have a look at the issue the next days.

Hi there, unfortunately I get this error:

Stack trace:
#0 /var/www/mydomain/htdocs/lib/pkp/classes/filter/Filter.inc.php(449): DNBXmlFilter->process(Object(ArticleGalley))
#1 /var/www/mydomain/htdocs/classes/plugins/PubObjectsExportPlugin.inc.php(391): Filter->execute(Object(ArticleGalley), true)
#2 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(906): PubObjectsExportPlugin->exportXML(Object(ArticleGalley), 'galley=>dnb-xml', Object(Journal), true)
#3 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(766): DNBExportPlugin->getGalleyPackage(Object(ArticleGalley), Array, 'galley=>dnb-xml', true, Object(Journal), 'dnb/1-20240826-...', '', 2126)
#4 /var/www/mydomain/htdocs/classes/plugins/PubObjectsExportPlugin.inc.php(171): DNBExportPlugin->executeExportAction(Object(Request), Array, 'galley=>dnb-xml', 'exportSubmissio...', 'articles', true)
#5 /var/www/mydomain/htdocs/plugins/importexport/dnb/DNBExportPlugin.inc.php(201): PubObjectsExportPlugin->display(Array, Object(Request))
#6 /var/www/mydomain/htdocs/lib/pkp/pages/management/PKPToolsHandler.inc.php(94): DNBExportPlugin->display(Array, Object(Request))
#7 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPRouter.inc.php(397): PKPToolsHandler->importexport(Array, Object(Request))
#8 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#9 /var/www/mydomain/htdocs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route(Object(Request))
#10 /var/www/mydomain/htdocs/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch(Object(Request))
#11 /var/www/mydomain/htdocs/index.php(68): PKPApplication->execute()
#12 {main}
  thrown in /var/www/mydomain/htdocs/plugins/importexport/dnb/filter/DNBXmlFilter.inc.php on line 128

I searched for Submission::getAccessStatus() but only found Issue::getAccessStatus(). Versions:

* `ojs-3.3.0-18` + `ojs-3.3.0-19`

* `dnb-1.5.0`

So this is an error in the plugin and not in my configuration?

ronste commented 3 months ago

I tested the fix and created a new release Package: https://github.com/ojsde/dnb/releases

bbx-github commented 3 months ago

@ronste Thanks a lot! I installed the new release package dnb-1.5.1.tar.gz and the error is gone! šŸŽ‰