Need help fixing keywords encoding or regenearting keywords table - OJS 3.2.1.1

Hello everyone!

Once upon a time we upgraded from OJS 2 to OJS 3 and faced some problems due to character encoding originating a “Failed AJAX request or invalid JSON returned” error. I was able to solve the problem for the es_ES locale thanks to @asmecher 's tips

Now … after upgrading from 3.1.2.1 to 3.2.1.1 the es_ES locale is still working OK, but if I add any other locale (tested with pt_BR, it_IT, fr_FR) I cannot access the email templates. So I started working on FIXING the problem instead of PATCHING it…

To make the story short

  1. I changed “connection_charset” from Off to utf-8 and the whole site showed ‘code’ instead of special characters (ex: é instead of é)
  2. I dumped each table of the OJS database to a separated .sql file
  3. I replaced all corresponding characters in the relevant .sql files (ex: sed -i ‘s/é/é/g’ author_settings.sql)
  4. I reimported the .sql file to overwrite the previous table with the fixed one
  5. Profit (almost)

This process has proven to be very successful for these tables:
announcement_settings.sql
article_notes.sql
author_settings.sql
citation_settings.sql
citations.sql
journal_settings.sql
navigation_menu_item_settings.sql
publication_settings.sql
review_form_settings.sql
review_form_element_settings.sql
static_page_settings.sql
user_settings.sql
user_group_settings.sql
issue_settings.sql
section_settings.sql
metadata_description_settings.sql

But when I try to do the same with submission_search_keyword_list.sql and import it, I get an error due to duplicate entries …

So here is the question:

Is there a way to empty the submission_search_keyword_list table and re-populate it from the contents of the database?

Thanks in advance and sorry fo the long post!

Hi @hilongo,

You can delete all contents from the submission_search_keyword_list, submission_search_object_keywords, and submission_search_objects tables and re-generate the contents afterwards using tools/rebuildSearchIndex.php.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thank you very much @asmecher … That was exactly what I was needing.

I’m getting two types of warnings upon running tools/rebuildSearchIndex.php for some (not all) journals

the more frecuent is
PHP Notice: Array to string conversion in /var/www/html/ojs3/lib/pkp/classes/search/SubmissionSearchIndex.inc.php on line 37

and a couple of
PHP Notice: unserialize(): Error at offset 235 of 677 bytes in /var/www/html/ojs3/lib/pkp/classes/db/DAO.inc.php on line 357

I’m pretty sure they are related to still-not-fixed strings, so I expect them to go away when my work is complete.

Thanks again!

1 Like