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

OJS crashes after activating the plugin #11

Open
oBlissing opened this issue May 18, 2021 · 5 comments
Open

OJS crashes after activating the plugin #11

oBlissing opened this issue May 18, 2021 · 5 comments

Comments

@oBlissing
Copy link

Setup:

  • customLocale v1_1_0-1
  • PHP 7.4
  • OJS 3.3.0-6
  • Windows 10

Installed by extracting tar into <ojs>/plugins/generic/

[Tue May 18 16:17:05.276134 2021] [php7:error] [pid 6576:tid 1088] [client ::1:63979] PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in D:\\ApacheHosted\\ojs\\plugins\\generic\\customLocale\\CustomLocalePlugin.inc.php:32\nStack trace:\n#0 D:\\ApacheHosted\\ojs\\lib\\pkp\\classes\\plugins\\PluginRegistry.inc.php(69): CustomLocalePlugin->register('generic', 'plugins/generic...', NULL)\n#1 D:\\ApacheHosted\\ojs\\lib\\pkp\\classes\\plugins\\PluginRegistry.inc.php(142): PluginRegistry::register('generic', Object(CustomLocalePlugin), 'plugins/generic...', NULL)\n#2 D:\\ApacheHosted\\ojs\\lib\\pkp\\classes\\core\\Dispatcher.inc.php(133): PluginRegistry::loadCategory('generic', true)\n#3 D:\\ApacheHosted\\ojs\\lib\\pkp\\classes\\core\\PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))\n#4 D:\\ApacheHosted\\ojs\\index.php(68): PKPApplication->execute()\n#5 {main}\n  thrown in D:\\ApacheHosted\\ojs\\plugins\\generic\\customLocale\\CustomLocalePlugin.inc.php on line 32

$contextFileManager = new ContextFileManager($context->getId());

@asmecher
Copy link
Member

@oBlissing, I think you are in the same situation as pkp/pkp-lib#6137, where the plugin was somehow enabled site-wide when it's intended to be enabled/disabled for each plugin separately. Do you have any insight on how this happened? Were there any unusual steps in installing/enabling the plugin?

@oBlissing
Copy link
Author

@asmecher That explains it. I am intending to use it site-wide, so the site-wide installation was intentional :)
Looks like I'll have to look elsewhere to solve this. Thanks for the quick response!

@asmecher
Copy link
Member

@oBlissing, where did you get the code you installed from? Is it one of the github repositories directly (e.g. the main branch), or one of the release .tar.gz packages? If the latter, what version?

@oBlissing
Copy link
Author

oBlissing commented May 20, 2021

@asmecher I downloaded the latest tar from the release-section on this repository page.

From this link: https://github.com/pkp/customLocale/releases/download/v1_1_0-1/customLocale-v1_1_0-1.tar.gz

@asmecher
Copy link
Member

@oBlissing, at a glance, support for this plugin at the site level could be added very easily by simply using:

$context ? $context->getId() : CONTEXT_SITE

...in place of...

$context->getId()

If you're handy with PHP, you might give this a quick try. Your confirmation (and, if it works, a pull request) will help get this included in the next release!

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