[OJS 2.4.8.5 to OJS 3.2.0-3]: warning and notice related to concatenateIntoAbout and concatenateIntoMasthead

[code: Installer Installer::concatenateIntoAbout]

Warning: Illegal string offset ‘en_US’ in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

[code: Installer Installer::concatenateIntoMasthead]

Warning: Illegal string offset ‘en_US’ in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Notice: Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: ED in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: ED in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Warning: Cannot use a scalar value as an array in /var/www/html/lib/pkp/classes/db/SettingsDAO.inc.php on line 35

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Notice: Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Dear all,
I run upgrade script with success but during execution it returns to me some errors in the list above.
I have searched in all the forum for a solution or posts with same problems but I haven’t found anything.
Anyone with ideas?
Thank you very much
Regards
Antonio

Hi @Antonio_Fracasso,

I think you have some invalid data in your journal_settings table, specifically settings that have a mix of localized (language-specific) and non-localized content. Did you work with data in that table manually? What do you get for the following query?

SELECT DISTINCT a.setting_name FROM journal_settings a JOIN journal_settings b ON (a.setting_name = b.setting_name AND a.locale IS NULL and b.locale IS NOT NULL);

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

I can work with database manually, and I can operate with data.

When I ran your query, I found 0 records, but if I change null value with empty string:

SELECT DISTINCT a.setting_name FROM journal_settings a JOIN journal_settings b ON (a.setting_name = b.setting_name AND a.locale = "" and b.locale <> "");

I find two records:
authorSelfArchivePolicy
metaCitations

Duplicated value for empty string?

UPGRADE
A query for “authorSelfArchivePolicy” reveal a group of records with no locale and two records for the same journal_id, one with locale en_US and the other with empty string.
A query for “metaCitations” reveal two kind of setting_type, bool and string for a group of 8 journal_id while other records have only one type of “metaCitations” setting_type, bool.

Thank you

Regards,
Antonio

Hi @Antonio_Fracasso,

Ah, that does help, thanks.

You can remove all entries from journal_settings with setting_name='metaCitations'.

As for authorSelfArchivePolicy, the locale field should always be set to a valid locale (e.g. en_US for U.S. English – see the list in registry/locales). I’d suggest correcting these in the database before running the upgrade script. Make sure to delete all .php files from cache/ after making changes like this in the database, to ensure that cached data isn’t interfering with the updated settings. (And please make sure you have a good backup before doing any of this!)

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

first of all, thank you very much for your help.
I have applied solutions from your post and partially solved the problems.
I have no warnings and notice for concatenateIntoAbout but for the step concatenateIntoMasthead:

> [code: Installer Installer::concatenateIntoMasthead]
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: USA in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: ED in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: ED in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289
> PHP Notice:  Undefined index: UK in /var/www/html/classes/install/Upgrade.inc.php on line 2289

Ok, these errors are only notice but now, at the begin of migration script I receive this warning:

> PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed 'SCHEMA_PUBLICATION' (this will throw an Error in a future version of PHP) in /var/www/html/lib/pkp/includes/functions.inc.php on line 223
> PHP Warning: Use of undefined constant SCHEMA_PUBLICATION - assumed 'SCHEMA_PUBLICATION' (this will throw an Error in a future version of PHP) in /var/www/html/lib/pkp/includes/functions.inc.php on line 223
> PHP Warning: Creating default object from empty value in /var/www/html/classes/plugins/PubObjectsExportPlugin.inc.php on line 62

And after setFileName a lot of this notice:

> [code: Installer Installer::setFileName]
> PHP Notice: Undefined property: stdClass::$id in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Trying to get property 'type' of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Undefined property: stdClass::$accessStatus in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Trying to get property 'type' of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Undefined property: stdClass::$lastModified in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Trying to get property 'type' of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Undefined property: stdClass::$locale in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Trying to get property 'type' of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Undefined property: stdClass::$primaryContactId in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Trying to get property 'type' of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Undefined property: stdClass::$sectionId in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
> PHP Notice: Trying to get property 'type' of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235

Migration script close its run with success.
I suppose that the second problem its related to this query:

ALTER TABLE article_galleys MODIFY COLUMN file_id INT;

But I’m not sure.

Could you help me again?

Thank you very much

Regards,
Antonio

Hi @Antonio_Fracasso,

Did you manually load content into your database? It looks like you have some locale column values like USA and UK, where OJS expects the form xx_YY (xx for language, e.g. en for English, and YY for country, e.g. US for U.S.A).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

thank you very much for your help.
I’m trying to solve other problems via forum posts.

Regards,
Antonio

1 Like

Hello @asmecher.

I have the same problem, upgrading ojs 2 to ojs 3.2. No errors about

concatenateIntoMasthead

But, errors in

[code: Installer Installer::setFileName]
PHP Notice: Undefined property: stdClass::$id in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
PHP Notice: Trying to get property ‘type’ of non-object in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235
PHP Notice: Undefined property: stdClass::$accessStatus in /var/www/html/lib/pkp/classes/db/SchemaDAO.inc.php on line 235

A lot of errors like that in upgrading process

Wich query can i do to know if some table is wrong?

Thanks

1 Like