A blank page return (3.4.0-1)

Describe the issue or problem
after upgrade to ojs-3.4.0-1, when guide to /index/user/profile page,
it will return blank page. And report error on Line 278 of Locale.php.

Steps I took leading up to the issue

  1. Using none english, for example I using zh_Hant
  2. go to Profile page ( /index/user/profile page)

What application are you using?
For example, OJS 3.4.0-1

Additional information
I had modify the code, now it work without any error return.
if (fn(string $locale) =>$this->getMetadata($locale)->getDisplayName() === null){
return $this->supportedLocaleNames ??= array_map(fn (string $locale) =>‘zh_Hant’, $this->_getSupportedLocales());
} else {
return $this->supportedLocaleNames ??= array_map(fn (string $locale) => $this->getMetadata($locale)->getDisplayName(), $this->_getSupportedLocales());
}

Hi @mayh,

Can you include details about the error message that was reported?

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi, asmecher,

I had edit the code, the line number change to 281 in my edit version, same to 278.


Fatal error: Uncaught Error: Call to a member function getDisplayName() on null in /var/www/ojs-3.4.0-1/lib/pkp/classes/i18n/Locale.php:281 Stack trace: #0 [internal function]: PKP\i18n\Locale->PKP\i18n\{closure}() #1 /var/www/ojs-3.4.0-1/lib/pkp/classes/i18n/Locale.php(281): array_map() #2 /var/www/ojs-3.4.0-1/lib/pkp/classes/i18n/Locale.php(270): PKP\i18n\Locale->getSupportedLocales() #3 /var/www/ojs-3.4.0-1/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): PKP\i18n\Locale->getSupportedFormLocales() #4 /var/www/ojs-3.4.0-1/lib/pkp/classes/form/Form.php(85): Illuminate\Support\Facades\Facade::__callStatic() #5 /var/www/ojs-3.4.0-1/lib/pkp/classes/user/form/BaseProfileForm.php(37): PKP\form\Form->__construct() #6 /var/www/ojs-3.4.0-1/lib/pkp/classes/user/form/ContactForm.php(34): PKP\user\form\BaseProfileForm->__construct() #7 /var/www/ojs-3.4.0-1/lib/pkp/controllers/tab/user/ProfileTabHandler.php(104): PKP\user\form\ContactForm->__construct() #8 [internal function]: PKP\controllers\tab\user\ProfileTabHandler->contact() #9 /var/www/ojs-3.4.0-1/lib/pkp/classes/core/PKPRouter.php(334): call_user_func() #10 /var/www/ojs-3.4.0-1/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest() #11 /var/www/ojs-3.4.0-1/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route() #12 /var/www/ojs-3.4.0-1/lib/pkp/classes/core/PKPApplication.php(373): PKP\core\Dispatcher->dispatch() #13 /var/www/ojs-3.4.0-1/index.php(21): PKP\core\PKPApplication->execute() #14 {main} thrown in /var/www/ojs-3.4.0-1/lib/pkp/classes/i18n/Locale.php on line 281

Hi @mayh,

Could you try reverting your change, and then applying the change proposed in this github issue?

I think that should fix it, but your confirmation will help!

Thanks,
Alec Smecher
Public Knowledge Project Team

1 Like

Dear asmecher,
It’s work, thank you.

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