Fatal Error on Turkish on UserRolesRequiredPolicy.inc.php at line 49

Hello,

When I select as Language Turkish, get this error:

Fatal error: Call to undefined method User::getId() in /lib/pkp/classes/security/authorization/UserRolesRequiredPolicy.inc.php on line 49.

When I delete cookies, I can open ojs as English. But when I select Russian there is no problem.

How can we solve this problem?
OJS version is 2.4.8 (latest stable version)

Hi @Yusif,

This is a very weird known issue with PHP. See http://www.sobstel.org/blog/php-call-to-undefined-method-on-tr-tr-locale/ for details.

To work around it, you’ll need to edit lib/pkp/classes/i18n/PKPLocale.inc.php, find the initialize function, and add this to the end of the function:

if ($locale == 'tr_TR') setlocale(LC_CTYPE, 'en_US');

Regards,
Alec Smecher
Public Knowledge Project Team

(See also: Fix turkish language selection by gabriele-h · Pull Request #5443 · pkp/pkp-lib · GitHub)