mayh
June 26, 2023, 3:18am
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
Using none english, for example I using zh_Hant
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
mayh
June 27, 2023, 5:56am
3
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?
opened 08:23PM - 27 Jun 23 UTC
Bug:2:Moderate
**Describe the bug**
The `zh_Hant` locale cannot be installed (for new installa… tions) and may cause disruptions with upgraded locales.
See: https://forum.pkp.sfu.ca/t/a-blank-page-return-3-4-0-1/79453/3
**What application are you using?**
OJS 3.3.0-1
I think that should fix it, but your confirmation will help!
Thanks,
Alec Smecher
Public Knowledge Project Team
1 Like
mayh
June 28, 2023, 1:04am
6
Dear asmecher,
It’s work, thank you.
This topic was automatically closed after 12 days. New replies are no longer allowed.