Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add NULL check for context #9

Open
wants to merge 1 commit into
base: stable-3_2_1
Choose a base branch
from

Conversation

nils-stefan-weiher
Copy link

Hi Alec @asmecher ,

I added this fix previously for 3.1.2.
As we are currently upgrading our OJS instances to 3.2.1-1 I found that the upgrade script had an error because the plugin was expecting a context from a request during registration.

Error output from upgrade.php

nw@serv3:/web/htdocs-journals-3-2$ sudo -u www-data php tools/upgrade.php check             [55/1824]
PHP Fatal error:  Uncaught Error: Call to a member function getId() on null in /web/htdocs-journals-3
-2/plugins/generic/customLocale/CustomLocalePlugin.inc.php:32
Stack trace:                                      
#0 /web/htdocs-journals-3-2/lib/pkp/classes/plugins/PluginRegistry.inc.php(69): CustomLocalePlugin->$
egister('generic', 'plugins/generic...', NULL)                                
#1 /web/htdocs-journals-3-2/lib/pkp/classes/plugins/PluginRegistry.inc.php(144): PluginRegistry::reg$
ster('generic', Object(CustomLocalePlugin), 'plugins/generic...', NULL)
#2 /web/htdocs-journals-3-2/lib/pkp/classes/cliTool/CliTool.inc.php(65): PluginRegistry::loadCategor$
('generic')                                           
#3 /web/htdocs-journals-3-2/lib/pkp/classes/cliTool/UpgradeTool.inc.php(35): CommandLineTool->__cons$
ruct(Array)                   
#4 /web/htdocs-journals-3-2/tools/upgrade.php(21): UpgradeTool->__construct(Array)
#5 {main}                                                               
  thrown in /web/htdocs-journals-3-2/plugins/generic/customLocale/CustomLocalePlugin.inc.php on line
32

I dont know why this was not coming up in other installations?

@asmecher
Copy link
Member

asmecher commented Feb 1, 2021

@isgrim, I suspect somehow the plugin is enabled site-wide for that installation. Check plugin_settings for setting_name='enabled' AND LOWER(plugin_name)=LOWER('CustomLocalePlugin') AND context_id=0; there shouldn't be any entries like that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants