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 not allowing the "Save" button to work #29

Closed
1amrahulranjan opened this issue Aug 22, 2022 · 9 comments
Closed

Plugin not allowing the "Save" button to work #29

1amrahulranjan opened this issue Aug 22, 2022 · 9 comments

Comments

@1amrahulranjan
Copy link

Hi,

I am trying to use this feature and activated "Browse by Section" Plugin from OJS Plugin gallery and activated it. However, when I go to the section, edit them and check the box that says "Section Browsing - Enable an archive of all submissions published in this section" and then click save, the save button keeps on loading and never saves the options.

I am attaching the screenshots for the same. Please help me out. I am using OJS 3.3.0.10
Screenshot (35)
Screenshot (36)

@ctgraham
Copy link
Collaborator

ctgraham commented Aug 22, 2022

@1amrahulranjan , can you share the error message from your webserver logs, or from your browser's web inspector?

For example, to look at this through the Web Inspector, before clicking Save, launch the Web Inspector in your browser via the F12 key or by right clicking and selecting "Inspect" or "Inspect Element". Then switch to the Network tab. Click the "Save" button and find the POST request for "update-section". If this request has a Status of 500 where the 200 Status is expected, there may be useful information in the "Response" section.

image

The webserver error logs will likely be even more helpful, if you have access to them on the server.

@1amrahulranjan
Copy link
Author

Hi,

I did the inspect element thing. Here are the screenshots. There was no response in the response tab but the error was 500 instead of 200. Also, please find attached the Error Log that was located in the public_html folder itself.

Screenshot (37)
Screenshot (38)

Error Log with Screenshots.zip

@ctgraham
Copy link
Collaborator

ctgraham commented Aug 22, 2022

Thanks, @1amrahulranjan !

Maintainers, here is the error message of interest:

[22-Aug-2022 16:00:56 UTC] PHP Fatal error:  Uncaught Error: Non-static method PKPApplication::getRequest() cannot be called statically in plugins/generic/browseBySection/BrowseBySectionPlugin.inc.php:198
Stack trace:
#0 lib/pkp/classes/plugins/HookRegistry.inc.php(107): BrowseBySectionPlugin->executeSectionFormFields('sectionform::ex...', Array)
#1 lib/pkp/classes/form/Form.inc.php(314): HookRegistry::call('sectionform::ex...', Array)
#2 lib/pkp/controllers/grid/settings/sections/form/PKPSectionForm.inc.php(117): Form->execute(Array)
#3 controllers/grid/settings/sections/form/SectionForm.inc.php(190): PKPSectionForm->execute()
#4 controllers/grid/settings/sections/SectionGridHandler.inc.php(213): SectionForm->execute()
#5 lib/pkp/classes/core/PKPRouter.inc.php(395): SectionGridHandler->updateSection(Array, Object(Request))
#6 lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#7 lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#8 lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#9 index.php(68): PKPApplication->execute()
#10 {main}
  thrown in plugins/generic/browseBySection/BrowseBySectionPlugin.inc.php on line 198

$section = $sectionDao->getById($sectionForm->getSectionId(), Application::getRequest()->getContext()->getId());

@1amrahulranjan
Copy link
Author

1amrahulranjan commented Aug 23, 2022

How can I get this working? Please help @ctgraham @asmecher @jalperin @mtub

@ctgraham
Copy link
Collaborator

@1amrahulranjan , if you are able to download the updated source code from this branch of the repo:
https://github.com/pkp/browseBySection/tree/issue-29

And, if you are able to install this manually in your OJS installation, then you can try it out the fix before an official release.

@1amrahulranjan
Copy link
Author

@ctgraham Yes I can do it. So, all I need to do is download the code as zip file and upload it (and overwrite it) in the OJS Directory where the plugin is stored. Right?

If I am wrong, could you please guide me how to do it? That would be very kind of you.

@ctgraham
Copy link
Collaborator

Yes, you can overwrite the existing plugin code with the contents downloaded in the zip file.

@1amrahulranjan
Copy link
Author

@ctgraham Thank you. The issue got resolved.

NateWr added a commit that referenced this issue Aug 24, 2022
#29: Remove static call to Application::getRequest()
@NateWr
Copy link
Contributor

NateWr commented Aug 24, 2022

I've merged that in. Thanks for reporting and thanks for the help, @ctgraham!

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

3 participants