Problems with user

good morning to all
I have updated the version to ojs 3.1 since version 2.4, previously I did update tests to 3.0 from version 2.4 and everything worked correctly, we had not finished the migration when the new version 3.1 came out so we decided to try it and migrate from 2.4 . when migrating in this new version the first problem we encountered was the php version which we updated, we actually update apache completely, we use ubuntu. after doing this update we did the migration process to ojs without any problem.
but my ojs 3.1 is not working well, it is sending me strange characters instead of the accents, and in the User & Roles section it does not show me the users it stays loading the information.
eh investigated that can be the format with which the information is saved because mysql has the format utf8mb4 the configuration of my eyes is in utf-8.
Because you can be hanging the User & Roles section.
Note: Although I can not see the users in this section, I can log in with them.

Hi @JoannaB,

When a page is endlessly trying to load, like your user roles section, usually a PHP error has occurred. Please check your error log for details. You can also probably find more information there about the problems you’re having with characters.

Best,
Amanda Stevens
Public Knowledge Project Team

Thanks for answering
Checking the error log I found the following messages.

[Wed Nov 29 08:46:02.893948 2017] [:error] [pid 7894] [client 148.231.55.56:57281] PHP Warning: Cannot use a scalar value as an array in /var/www/ojs3111/lib/pkp/classes/core/DataObject.inc.php on line 133
[Wed Nov 29 08:46:02.894154 2017] [:error] [pid 7894] [client 148.231.55.56:57281] PHP Warning: Cannot use a scalar value as an array in /var/www/ojs3111/lib/pkp/classes/core/DataObject.inc.php on line 133
[Wed Nov 29 08:46:02.894256 2017] [:error] [pid 7894] [client 148.231.55.56:57281] PHP Notice: unserialize(): Error at offset 186 of 416 bytes in /var/www/ojs3111/lib/pkp/classes/db/DAO.inc.php on line 352
[Wed Nov 29 08:46:02.991694 2017] [:error] [pid 7895] [client 148.231.55.56:57282] PHP Warning: Cannot use a scalar value as an array in /var/www/ojs3111/lib/pkp/classes/core/DataObject.inc.php on line 133
[Wed Nov 29 08:46:02.991909 2017] [:error] [pid 7895] [client 148.231.55.56:57282] PHP Warning: Cannot use a scalar value as an array in /var/www/ojs3111/lib/pkp/classes/core/DataObject.inc.php on line 133
[Wed Nov 29 08:46:02.992021 2017] [:error] [pid 7895] [client 148.231.55.56:57282] PHP Notice: unserialize(): Error at offset 186 of 416 bytes in /var/www/ojs3111/lib/pkp/classes/db/DAO.inc.php on line 352

I still do not understand what my mistake is.

Hi @JoannaB,

The cause of the “PHP Warning: Cannot use a scalar value as an array in /var/www/ojs3111/lib/pkp/classes/core/DataObject.inc.php on line 133” message is a mix of localized (locale column is set) and non-localized (locale column is empty or null) for a single setting_name, which is a data error.

To figure out which settings it’s referring to, you can edit lib/pkp/classes/core/DataObject.inc.php, and find line 133 or so, which should look like:
$this->_data[$key][$locale] = $value;
Just before this, add:
if (isset($this->_data[$key]) && !is_array($this->_data[$key])) error_log('Mixed localization for ’ . get_class($this) . ‘, setting "’ . $key . ‘"’);
Then trigger the warning again (e.g. by reloading the page you saw it on before), and look in your log for more details.

Regarding the strange characters instead of accents, you can check your character set configuration in config.inc.php and make sure it’s UTF8 throughout. Sometimes upgrading can inadvertently change your configuration.

Let me know how this goes.

Best,
Amanda Stevens
Public Knowledge Project Team

I checked my configuration…
My problem is that mysql changed a new format utf8mb4 and all datas are with this format… and not in utf8
When I change to utf8mb4 my file config.inc.php I can see my text with strange characteres perfectly… My problem is that all content table now is in white.
Thanks

Hi @JoannaB,

Do you mean that you see blank pages on your site? I’m sorry but I don’t understand exactly what the problem is.

Did you try my suggestion above to debug your database and figure out where the localized settings need to be changed?

Thanks,
Amanda Stevens
Public Knowledge Project Team

Hello I did what they recommended me and this is the error that appears in my register …

[Tue Dec 12 09:44:56.766471 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP Parse error: syntax error, unexpected ‘error_log’ (T_STRING) in /var/www/ojs31/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.766498 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP Stack trace:, referer: http://148.231.55.46ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.766503 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 1. {main}() /var/www/ojs31/index.php:0, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.768989 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 2. require() /var/www/ojs31/index.php:65, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773024 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 3. Application->__construct() /var/www/ojs31/lib/pkp/includes/bootstrap.inc.php:58, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773052 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 4. PKPApplication->__construct() /var/www/ojs31/classes/core/Application.inc.php:38, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773061 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 5. import() /var/www/ojs31/lib/pkp/classes/core/PKPApplication.inc.php:139, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773066 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 6. require_once() /var/www/ojs31/lib/pkp/includes/functions.inc.php:25, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773070 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 7. import() /var/www/ojs31/lib/pkp/classes/db/DAORegistry.inc.php:18, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773075 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 8. require_once() /var/www/ojs31/lib/pkp/includes/functions.inc.php:25, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access
[Tue Dec 12 09:44:56.773079 2017] [:error] [pid 3239] [client 148.231.55.56:58709] PHP 9. import() /var/www/ojs31/lib/pkp/classes/db/DAO.inc.php:26, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access

Hi @JoannaB,

That’s telling us there is a setting error in your journal settings table but it’s still not identifying where the error is. Can you try running this query in your database?

SELECT DISTINCT s1.setting_name FROM journal_settings s1, journal_settings s2 WHERE s1.setting_name = s2.setting_name AND s1.locale = ‘’ AND s2.locale <> ‘’;

Best,
Amanda Stevens
Public Knowledge Project Team

Hello,
The query does not yield any results.

because previously I had already executed
When I run the query the first time the answer was the following
metaCitations

I did what is recommended:

  • Delete both metaCitations entries from your DB
  • Flush the OJS data cache

Hi @JoannaB,

If you deleted the metaCitations entries and you’re still getting a blank screen and the parse error posted above, you can try some of the suggestions in this FAQ entry to identify the problem.

Best,
Amanda Stevens
Public Knowledge Project Team

Hi… I check var/log/apache2/errror.log and the message is this.

[Thu Dec 14 09:33:35.599988 2017] [:error] [pid 32657] [client 148.231.55.56:64638] Malformed UTF-8 characters, possibly incorrectly encoded, referer: http://148.231.55.46/ojs31/index.php/ref/management/settings/access

check my database and find that

database

and I find that one tables are like utf8-general but someones are like latin…
when I migrate my database to test. I used the command

mysqldump -u root -p --default-character-set=utf8 ojs-databse > backup.sql

for don`t have problems

Hi @JoannaB,

OJS only works with a single character set configuration (in config.inc.php), so I’m not sure how you’d get a mix of different encodings, unless e.g. your database configuration changed over time e.g. as you upgraded your OJS.

Disentangling mixed encodings is more of a database question than an OJS question – I’d suggest e.g. dumping your database, working with the dump file to ensure everything is consistent, then reloading it again. Something like https://ftfy.readthedocs.io might be useful.

Regards,
Alec Smecher
Public Knowledge Project Team