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

Fix Plugin for OPS #125

Open
3 of 6 tasks
nuest opened this issue Jul 31, 2023 · 3 comments
Open
3 of 6 tasks

Fix Plugin for OPS #125

nuest opened this issue Jul 31, 2023 · 3 comments
Labels
OPS Open Preprint Server-related issues

Comments

@nuest
Copy link
Collaborator

nuest commented Jul 31, 2023

  • Enable Geo Plugin
  • Enable Theme Plugin
  • Make a submission
  • Publish submission
  • Map is shown on submission page
  • Overall map page works
@nuest nuest added the OPS Open Preprint Server-related issues label Jul 31, 2023
@nuest
Copy link
Collaborator Author

nuest commented Jul 31, 2023

(Just recording the results of a previously internal evaluation:)

Submission worked fine, entering metadata worked fine, but there seem to be issues with the integration of the map in the theme.
Only the dedicated map page works:

image

The hook names are different and need to be changed.

  • Templates::Preprint::Main instead of Templates::Article::Main
  • Templates::Preprint::Details instead of Templates::Article::Details

This requires conditional checking for the base software used and then calling the right hook.

@nuest
Copy link
Collaborator Author

nuest commented Jul 31, 2023

A quick check is documented in this commit in the branch ops: https://github.com/nuest/optimetaGeo/tree/ops

Renaming the hook names works for article views!

image

@nuest
Copy link
Collaborator Author

nuest commented Jul 31, 2023

Other plugins seem to handle this by simply calling multiple handlers: https://github.com/pkp/googleScholar/blob/4bf4dad2be7389898af4458f307413fa2b0c93ff/GoogleScholarPlugin.php#L40 though this requires to call only generic functions, so in our case conditional checking is probably needed.

For example, to fix the HTML metadata in the HEAD, simply doing

HookRegistry::register('PreprintHandler::view', array(&$this, 'extendArticleView'));

does not work

[Mon Jul 31 15:19:11 2023] 127.0.0.1:34456 [500]: GET /index.php/geoprints/preprint/view/1 - Uncaught Error: Call to undefined method Publication::getCurrentPublication() in /home/daniel/git/OPTIMETA/optimetaGeo/OptimetaGeoPlugin.inc.php:160
Stack trace:
#0 /home/daniel/git/OPTIMETA/ops-3.3.0-15/lib/pkp/classes/plugins/HookRegistry.inc.php(107): OptimetaGeoPlugin->extendArticleView()
#1 /home/daniel/git/OPTIMETA/ops-3.3.0-15/pages/preprint/PreprintHandler.inc.php(263): HookRegistry::call()
#2 /home/daniel/git/OPTIMETA/ops-3.3.0-15/lib/pkp/classes/core/PKPRouter.inc.php(397): PreprintHandler->view()
#3 /home/daniel/git/OPTIMETA/ops-3.3.0-15/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()
#4 /home/daniel/git/OPTIMETA/ops-3.3.0-15/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()
#5 /home/daniel/git/OPTIMETA/ops-3.3.0-15/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()
#6 /home/daniel/git/OPTIMETA/ops-3.3.0-15/index.php(68): PKPApplication->execute()
#7 {main}
  thrown in /home/daniel/git/OPTIMETA/optimetaGeo/OptimetaGeoPlugin.inc.php on line 160
[Mon Jul 31 15:19:11 2023] 127.0.0.1:34456 Closing

nuest added a commit to nuest/ojsGeo that referenced this issue Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OPS Open Preprint Server-related issues
Projects
None yet
Development

No branches or pull requests

1 participant