Wrong characters in affiliation

OJS version 3.3.0.16
PHP 8.0.30
Good day, we are having problems with publication in our journals since the affiliation metadata of some submissions appears with characters of: a:1:{s:5:”affiliation-name”;}, How can we address this problem?

Thank you

Hi @alexpineda,

I suspect this is related to the RoR plugin. Are you actively using it? Did you previously use it but then remove it?

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher, thanks for the prompt response
We are not using the ROR plugin and it has not been used either, we have had this problem even before the migration to the version from OJS 3.2.1.1 to OJS 3.3.0.16. Doing tests we found that the error is being generated from the very creation of the user since the “affiliation” section is completed but when the profile is validated this section is loaded with an “array” as shown in the image. When this user initiates a submission, the author’s “affiliation” field is left with an inappropriate structure as shown in the image and this is reflected at the time of publishing.

Hi @alexpineda,

I’d suggest looking in the user_settings table where setting_name = 'affiliation' to see what the difference between the working and not-working accounts is. I suspect there was an upgrade hiccough many versions ago, and this is what resulted.

You should be able to check how many problem entries there are with a query like:

SELECT COUNT(*) FROM user_settings WHERE setting_name = 'affiliation' AND setting_value LIKE 'a:%';

Regards,
Alec Smecher
Public Knowledge Project Team

hi @asmecher
Validating the “user_settings” table does not find ‘a:%’ but does find 18 ‘setting_value’ with ‘array’.
The same search was performed in the “author_settings” table last week after the migration, finding 2648 elements with ‘a:{’, these were corrected and with this all publications to date were adjusted; In less than 15 days there are already 29 new ‘affiliation’ in the “author_settings” table with errors of ‘a:%’, visually affecting the publications.
select * from author_settings where setting_name like ‘affiliation’ and setting_value like ‘%a:1%’;


Hi @alexpineda,

That’s very odd – the affiliation entries are supposed to be one row per language, with the locale column indicating the language, and setting_value containing just the text for that language. It appears that yours has a PHP array packed into setting_value instead.

If I were fixing this, I’d probably throw together a short PHP script to fix the bad data. I’m not sure how it would’ve gotten that way – perhaps operating on a database with a new codebase after a failed upgrade, or some kind of customization?

I suspect the values that simply contain Array are what happens when you continue to operate the system with the bad data in place – eventually it gets cast from an array to a string, and the actual content gets clobbered with just the value Array.

Regards,
Alec Smecher
Public Knowledge Project Team