OJS: Upgrade to 3.4.0-7 on Locale.php: blank page

Hi all,
I upgraded an instance from 3.3.0-13 to 3.4.0-7, with postgresql as database.

The upgrade via shell was fine, but I can’t see the homepage an
I have this stacktrace:

<b>Fatal error</b>:  Uncaught TypeError: array_combine(): Argument #1 ($keys) must be of type array, false given in /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/Locale.php:497
Stack trace:
#0 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/Locale.php(497): array_combine()
#1 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/Locale.php(262): PKP\i18n\Locale-&gt;_getSupportedLocales()
#2 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): PKP\i18n\Locale-&gt;isSupported()
#3 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/translation/LocaleBundle.php(126): Illuminate\Support\Facades\Facade::__callStatic()
#4 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/translation/LocaleBundle.php(64): PKP\i18n\translation\LocaleBundle-&gt;getTranslator()
#5 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/Locale.php(421): PKP\i18n\translation\LocaleBundle-&gt;translateSingular()
#6 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/Locale.php(105): PKP\i18n\Locale-&gt;translate()
#7 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(938): PKP\i18n\Locale-&gt;get()
#8 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(973): trans()
#9 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/template/PKPTemplateManager.php(173): __()
#10 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/classes/template/TemplateManager.php(40): PKP\template\PKPTemplateManager-&gt;initialize()
#11 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/template/PKPTemplateManager.php(1438): APP\template\TemplateManager-&gt;initialize()
#12 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/plugins/Plugin.php(403): PKP\template\PKPTemplateManager::getManager()
#13 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/plugins/Plugin.php(137): PKP\plugins\Plugin-&gt;_registerTemplateResource()
#14 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/plugins/LazyLoadPlugin.php(34): PKP\plugins\Plugin-&gt;register()
#15 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/plugins/generic/datacite/DatacitePlugin.php(60): PKP\plugins\LazyLoadPlugin-&gt;register()
#16 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/plugins/PluginRegistry.php(76): APP\plugins\generic\datacite\DatacitePlugin-&gt;register()
#17 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/plugins/PluginRegistry.php(121): PKP\plugins\PluginRegistry::register()
#18 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins\{closure}()
#19 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/plugins/PluginRegistry.php(121): array_walk_recursive()
#20 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/core/Dispatcher.php(155): PKP\plugins\PluginRegistry::loadCategory()
#21 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher-&gt;dispatch()
#22 /data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/index.php(21): PKP\core\PKPApplication-&gt;execute()
#23 {main}
  thrown in <b>/data-ojs-service/scripts/-scripts/www/www-ojs3407-myinstance-test/lib/pkp/classes/i18n/Locale.php</b> on line <b>497</b><br />

How to solve this?
thanks,
Alfredo

Hi @Alfredo_Cosco,

Can you confirm a few things?

  • When the upgrade completed, did you get a confirmation that it was successful?
  • Did you change the locale setting in config.inc.php per the 3.4.0 Release Notebook?

Thanks,
Alec Smecher
Public Knowledge Project Team

Hello Alec,

  1. Yes, I can confirm that the upgrade finished with:
    “Successfully upgraded to version 3.4.0.7”
    (an assumption full of hope :slight_smile: )

  2. Currently locale settings are very standard:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Localization Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;

[i18n]

; Default locale
locale = en

; Database connection character set
connection_charset = utf8

Thanks,
Alfredo

Hi all,
I downloaded the latest OJS 3.4.0-7 and execute all the required information for installation and hitting the http://localhost:8000 on the browser I got the following error (stacktrace):

#15 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/index.php(21): PKP\core\PKPApplication->execute()
#16 {main}
  thrown in /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/i18n/Locale.php on line 148
[Thu Sep 19 22:18:31 2024] [::1]:51542 [200]: GET / - Uncaught Error: Class "Locale" not found in /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/i18n/Locale.php:148
Stack trace:
#0 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/i18n/Locale.php(130): PKP\i18n\Locale->setLocale()
#1 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): PKP\i18n\Locale->getLocale()
#2 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/template/PKPTemplateManager.php(161): Illuminate\Support\Facades\Facade::__callStatic()
#3 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/classes/template/TemplateManager.php(40): PKP\template\PKPTemplateManager->initialize()
#4 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/template/PKPTemplateManager.php(1438): APP\template\TemplateManager->initialize()
#5 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/plugins/Plugin.php(403): PKP\template\PKPTemplateManager::getManager()
#6 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/plugins/Plugin.php(137): PKP\plugins\Plugin->_registerTemplateResource()
#7 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/plugins/LazyLoadPlugin.php(34): PKP\plugins\Plugin->register()
#8 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/plugins/generic/googleAnalytics/GoogleAnalyticsPlugin.php(36): PKP\plugins\LazyLoadPlugin->register()
#9 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/plugins/PluginRegistry.php(76): APP\plugins\generic\googleAnalytics\GoogleAnalyticsPlugin->register()
#10 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/plugins/PluginRegistry.php(121): PKP\plugins\PluginRegistry::register()
#11 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins\{closure}()
#12 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/plugins/PluginRegistry.php(121): array_walk_recursive()
#13 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/core/Dispatcher.php(155): PKP\plugins\PluginRegistry::loadCategory()
#14 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher->dispatch()
#15 /home/vboxuser/ojs/tarball/ojs-3.4.0-7/index.php(21): PKP\core\PKPApplication->execute()
#16 {main}
  thrown in /home/vboxuser/ojs/tarball/ojs-3.4.0-7/lib/pkp/classes/i18n/Locale.php on line 148

I also got the same configuration as @Alfredo_Cosco . Any suggestion on how to solve the issue?

Thanks

Hi @njikonga-med,

That’s a different issue; your PHP installation is probably missing the intl extension.

Regards,
Alec Smecher
Public Knowledge Project Team

I confirm, I had to install the extensions:
initl & json
before I could finish (although with error) the installation,

Regards,
Alfredo

Thanks for the prompt reply, I confirm that by installing some necessary php extensions (intl, xml, mbr-string) the issue was resolved.
Regards,
Jehu Njikonga

1 Like

@asmecher
I can enter into the admin area, so I suppose that the error is in the template for the journal

Moreover, looking into the db I see that there are some tables with locale settings unchanged (i.e. en_US),
like:
group_settings
deposit_point_settings
journal_settings

what if I try to change those values to “en” in the db?
Thanks
Alfredo

This topic was automatically closed after 11 days. New replies are no longer allowed.

Hi all,
running this query:

SELECT * FROM public.journal_settings
WHERE setting_name LIKE '%Locales%'
ORDER BY journal_setting_id ASC 

I found some setting_value not in an array like form, simply a string:
default

so I changed the setting_value to:
[“en”]

and the error disappeared.

Now I have an other-one:

<b>Fatal error</b>:  Uncaught Error: Call to a member function getOption() on null in my_ojs/cache/t_compile/6b3184cb43debd008d31211f777bad58e1ae511b^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php:36
Stack trace:
#0 my_ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_670e649e5db7b9_56101893()
#1 my_ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base-&gt;getRenderedTemplateCode()
#2 my_ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled-&gt;render()
#3 my_ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template-&gt;render()
#4 my_ojs/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase-&gt;_execute()
#5 my_ojs/lib/pkp/classes/template/PKPTemplateManager.php(1369): Smarty_Internal_TemplateBase-&gt;display()
#6 my_ojs/pages/index/IndexHandler.php(83): PKP\template\PKPTemplateManager-&gt;display()
#7 [internal function]: APP\pages\index\IndexHandler-&gt;index()
#8 my_ojs/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()
#9 my_ojs/lib/pkp/classes/core/PKPPageRouter.php(278): PKP\core\PKPRouter-&gt;_authorizeInitializeAndCallRequest()
#10 my_ojs/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter-&gt;route()
#11 my_ojs/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher-&gt;dispatch()
#12 my_ojs/index.php(21): PKP\core\PKPApplication-&gt;execute()
#13 {main}
  thrown in <b>my_ojs/cache/t_compile/6b3184cb43debd008d31211f777bad58e1ae511b^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php</b> on line <b>36</b><br />

Even if I delete ALL the caches (data and temples) the error comes back.

Another strange issue is that:
keep in mind that this is a single journal installation without a press level. There’s only the main journal, along with two test journals that aren’t public.

I can access certain pages of the admin area, but all data related to the main journal coniguration seems to be lost, and all the configuration fields show the word “default.” :confused:

Hi @Alfredo_Cosco,

It’s intentional that some journal_settings entries are scalar values (e.g. default) and others are JSON-formatted strings (e.g. ['en']); it depends on the setting_name what the format of the value should be. I think your modifications to the table have probably caused the issues you encountered later.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi everyone, I was able to solve the issue and upgrade to the latest version of branch 3.4.

How did I do it?

  1. I analyzed the installation and found that:
  • a test journal and a non-public journal had fields marked as “required” that were not filled out. For the test journal, some fields were not able to be completed.
  1. I inserted “lorem ipsum” into the unfilled fields of the “non-public” journal.
  2. I deleted the test journal.
  3. I disabled all custom themes, assigning the default theme to all journals.
  4. Despite the presence of the code in these patches: Drop indexes only if they exist (https://forum.pkp.sfu.ca/t/ojs-upgra… · pkp/pkp-lib@c240da4 · GitHub I still had to force my upgrade scripts to delete those indexes before upgrading to 3.4.
  5. I had to remove all statistics related to the test address.
  6. So I first upgraded to release 3.3.0.19.
  7. At this point, the upgrade to 3.4.0.8 was successful.
  8. Then the themes were reinstalled from scratch and reset in the journals.