Submission Language drop-down menu is empty

Hello!

After OJS2 upgrade to OJS3 we are having some problem with language.
Can’t add new Article, because Submission Language drop-down menu is empty and the field is required:

error_log:

[16-Apr-2018 11:42:58 UTC] PHP Warning: array_keys() expects parameter 1 to be array, null given in /webpages/public_html/ojs/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 126
[16-Apr-2018 11:42:58 UTC] PHP Warning: array_shift() expects parameter 1 to be array, null given in /webpages/public_html/ojs/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 126
[16-Apr-2018 11:42:58 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /webpages/public_html/ojs/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 130
[16-Apr-2018 11:42:58 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /webpages/public_html/ojs/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 130
[16-Apr-2018 11:42:58 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /webpages/public_html/ojs/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 130
[16-Apr-2018 11:42:58 UTC] PHP Warning: in_array() expects parameter 2 to be array, null given in /webpages/public_html/ojs/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 130

Also, in Language settings it says “No Items”:

Any ideas how to fix this problem?
Kind regards

[23-Apr-2018 10:05:44 UTC] PHP Warning: Illegal string offset ‘en_US’ in /webpages/public_html/ojs/lib/pkp/classes/core/DataObject.inc.php on line 133

help

Hi @juhnson

Hmmm… That is strange…
Did you upgrade to the latest 3.1.1 version? What OJS 2 version did you have?
Did you have any warnings/error during the upgrade?
What do you have in your OJS 2 and OJS 3 database table site, columns primary_locale, installed_locales, supported_locales, as well in your table journal_settings where setting_name = ‘supportedFormLocales’, ‘supportedLocales’, ‘supportedSubmissionLocales’?

Best,
Bozana

hi @bozana
2.4.6 to 3.1.1 (Successfully upgraded to version 3.1.1.0), no warnings/errors during the upgrade.

Table: site (both ojs2 and ojs3 site tables are same)

min_password_length primary_locale installed_locales supported_locales original_style_file_name redirect
6 en_US en_US NULL 0

Table: journal_settings
supportedLocales a:1:{i:0;s:5:“en_US”;} object

OJS2 and OJS3 database in journal_settings only ‘supportedLocales’ exists, no setting_names like ‘supportedFormLocales’ or ‘supportedSubmissionLocales’. Should I add manually these settings?

I added manually ‘supportedFormLocales’ and ‘supportedSubmissionLocales’, but still same problem.
ojsdb

@juhnson, what is the primary_locale in your DB table journals?

@bozana

primaryLocale en_US (same value before upgrade and after upgrade)

Hmmm… Strange… I have no idea at the moment what is happening… :stuck_out_tongue:
Could you maybe try to clear cache and try the submit form again and see in the error log file if the warning are the same?

@bozana I think problem is somewhere in database. How should I clear the cache?

Hi all,

That languages grid (Setting > Website > Languages) is populated with this function: pkp-lib/ManageLanguageGridHandler.inc.php at ojs-3_1_1-0 · pkp/pkp-lib · GitHub. Is there a possibility for you to debug it and see what the variable $data contains before returned? – You could eventually add error_log(print_r($data, true)); before the return line pkp-lib/ManageLanguageGridHandler.inc.php at ojs-3_1_1-0 · pkp/pkp-lib · GitHub. Then you would see it in the server PHP error log file.

@orcalator, are your locale entries (s. above) in the DB table site, journals and journal_settings correct?

Thanks!
Bozana

@bozana,

I deleted post bcs. i realized language was not set for “Submissions” and “Forms” in Settings → Website → Languages. After i set it, it was ok. However “Submission Requirements” are gone in other language. I have them only in english. Not sure why.

Regards,

Nino

1 Like