[OJS] WARNING: Illegal string offset 'pt_BR'

Hi, while importing a journal using fullJournalTransfer i get the
following errors multiple times [show_stacktrace and display_errors on]:

ojs2 has produced an error Message: WARNING: Illegal string offset 'pt_BR' In file: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php At line: 135 Stacktrace: File: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php line 135 Function: PKPApplication->errorHandler(2, "Illegal string offset 'pt_BR'", "/srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php", 135, Array(3)) File: /srv/www/htdocs/pg/lib/pkp/classes/db/DAO.inc.php line 565 Function: DataObject->setData("cleanTitle", "Processos e substratos para produção de vinagres: uma revisão", "pt_BR") File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 234 Function: DAO->getDataObjectSettings("article_settings", "article_id", "4508", Object(Article)) File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 199 Function: ArticleDAO->_articleFromRow(Object(Article), Array(24)) File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 130 Function: ArticleDAO->_returnArticleFromRow(Array(24)) File: /srv/www/htdocs/pg/classes/file/ArticleFileManager.inc.php line 51 Function: ArticleDAO->getArticle("4508") File: /srv/www/htdocs/pg/plugins/importexport/fullJournalTransfer/XMLDisassembler.inc.php line 576 Function: ArticleFileManager->ArticleFileManager("4508") File: /srv/www/htdocs/pg/plugins/importexport/fullJournalTransfer/XMLDisassembler.inc.php line 108 Function: XMLDisassembler->importArticles() File: /srv/www/htdocs/pg/plugins/importexport/fullJournalTransfer/FullJournalImportExportPlugin.inc.php line 255 Function: XMLDisassembler->startImporting() File: /srv/www/htdocs/pg/plugins/importexport/fullJournalTransfer/FullJournalImportExportPlugin.inc.php line 111 Function: FullJournalImportExportPlugin->handleImport("/home/infra/piaa/IT.tar.gz", True) File: /srv/www/htdocs/pg/tools/importExport.php line 63 Function: FullJournalImportExportPlugin->executeCLI("tools/importExport.php", Array(0)) File: /srv/www/htdocs/pg/tools/importExport.php line 69 Function: importExport->execute() Server info: OS: Linux PHP Version: 5.4.45-0+deb7u2 Apache Version: N/A DB Driver: mysql DB server version: 5.5.38-0+wheezy1

There are a few occurrences of this for the fields: cleanTitle, title, abstract, biography (Function: DataObject->setData("biography", "", "pt_BR")), competingInterests and discipline.

In total there are 15 errors, a lot of them (if not all) comes from one single article, some are In file: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php and some are In file: /srv/www/htdocs/pg/lib/pkp/classes/db/DAO.inc.php.

Could anybody help me understand what is wrong and how to fix this?

The journal comes from a 2.4.6 and goes to a 2.4.7-1 OJS.

For reference:

Hi @samueloph,

We don’t maintain that plugin; I’d suggest sending a note to the plugin’s author letting them know about this post.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I just talked about the plugin to clarify exactly what i was doing, as i described on the other thread (and forgot to said here), i already talked with the plugin developer and he said this one was on OJS side.

What makes you believe this is not an OJS problem? I can give instructions on how to reproduce this without touching the third-party plugin, but i thought it was meaningless as the error was coming from OJS itself.

Thanks.

Hi @samueloph,

I believe the problem (on both threads) is that the full journal import/export plugin has added data to the database in a way that’s inconsistent with what OJS expects. Some fields in e.g. article_settings are expected to be localized (the locale field will be set) and some do not support localization (the locale field will be empty). If the value of the locale field does not meet OJS’s expectations, errors like what you’ve quoted will result.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I just emailed one of the developers again, sending the link of this thread and asking for help, maybe he will comment here. If i understood correctly this can have something to do with dealing with different OJS versions and instances (one can have a problematic database if not upgraded correctly in the past).

I’m sorry for creating two threads about an error caused by a third-party plugin, it wasn’t my intention at all.

Thanks for your attention and help.

Hi @asmecher,

I did some digging into this and found out that this is a problem that comes from our ojs installation that sources the journal imported, thus this doesn’t looks like a plugin problem (i believe the plugin only carries the error).

I discovered that we have three submissions for the same problematic article, one of them works and the other two are broken, i’ve got this error message (debug enabled) that comes when i try to see the submissions details (localhost/journal/editor/submission/4792) of both the problematic submissions, this is a published article so this details aren’t private.

`ojs2 has produced an error
Message: WARNING: Illegal string offset ‘pt_BR’
In file: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php
At line: 135
Stacktrace:
File: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php line
135
Function: PKPApplication->errorHandler(2, “Illegal string offset
‘pt_BR’”, “/srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php”,
135, Array(3))
File: /srv/www/htdocs/pg/lib/pkp/classes/db/DAO.inc.php line 565
Function: DataObject->setData(“abstract”, “

O
vinagre é um alimento milenar, sendo que há aproximadamente 5000 anos,
os egípcios, babilônios, indianos, persas e gregos já conheciam a
arte de fabricação e a versatilidade do vinagre, contudo ainda existem
poucos estudos na tentativa de conhecer e otimizar as etapas envolvidas
no processo produtivo. O objetivo desse trabalho é apresentar os
estudos realizados no intuito de aperfeiçoar os processos de produção
e de desenvolvimento de novos substratos para a fabricação de
vinagres. Trata-se de um alimento produzido por duas fermentações
sucessivas, alcoólica e acética, tornando necessário utilizar apenas
matérias-primas com amidos e/ou açúcares fermentescíveis, sendo que
os polissacarídeos devem primeiramente ser hidrolisados para conversão
em açúcares mais simples. Para a sua produção, podem ser utilizados
os processos tradicionais, sendo as fermentações realizadas de forma
espontânea e sem controle, dando origem a produto com sabores e aromas
peculiares, ou pelos métodos industriais, destacando o processo lento
ou Orleans, e o processo rápido, também conhecido por alemão ou
submerso. O processo rápido é o mais utilizado devido à sua alta
produtividade. Tendo em vista que o vinagre é um alimento muito
utilizado como tempero pela maioria da população, e na indústria
alimentícia como acidulante, conservante e aromatizante, é necessário
que mais estudos sejam conduzidos visando agregar maior valor a este
produto, por meio da utilização de diferentes substratos e na
tentativa de controlar e aperfeiçoar as etapas envolvidas em sua
produção.

”, “pt_BR”)
File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 234
Function: DAO->getDataObjectSettings(“article_settings”,
“article_id”, “4792”, Object(SectionEditorSubmission))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 114
Function:
ArticleDAO->_articleFromRow(Object(SectionEditorSubmission),
Array(25))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 96
Function:
SectionEditorSubmissionDAO->_returnSectionEditorSubmissionFromRow(Array(25))
File:
/srv/www/htdocs/pg/pages/sectionEditor/SectionEditorHandler.inc.php line
237
Function:
SectionEditorSubmissionDAO->getSectionEditorSubmission(4792)
File:
/srv/www/htdocs/pg/pages/sectionEditor/SubmissionEditHandler.inc.php
line 49
Function: SectionEditorHandler->validate(4792)
File: (unknown) line (unknown)
Function: SubmissionEditHandler->submission(Array(1),
Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRouter.inc.php line
362
Function: call_user_func(Array(2), Array(1), Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPPageRouter.inc.php
line 220
Function:
PKPRouter->_authorizeInitializeAndCallRequest(Array(2),
Object(Request), Array(1), False)
File: /srv/www/htdocs/pg/lib/pkp/classes/core/Dispatcher.inc.php line
134
Function: PKPPageRouter->route(Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php
line 178
Function: Dispatcher->dispatch(Object(Request))
File: /srv/www/htdocs/pg/index.php line 70
Function: PKPApplication->execute()
Server info:
OS: Linux
PHP Version: 5.4.45-0+deb7u2
Apache Version: Apache/2.2.22 (Debian)
DB Driver: mysql
DB server version: 5.5.38-0+wheezy1

ojs2 has produced an error
Message: WARNING: Illegal string offset ‘pt_BR’
In file: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php
At line: 135
Stacktrace:
File: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php line
135
Function: PKPApplication->errorHandler(2, “Illegal string offset
‘pt_BR’”, “/srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php”,
135, Array(3))
File: /srv/www/htdocs/pg/lib/pkp/classes/db/DAO.inc.php line 565
Function: DataObject->setData(“cleanTitle”, “Processos e
substratos para produção de vinagres: uma revisão”, “pt_BR”)
File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 234
Function: DAO->getDataObjectSettings(“article_settings”,
“article_id”, “4792”, Object(SectionEditorSubmission))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 114
Function:
ArticleDAO->_articleFromRow(Object(SectionEditorSubmission),
Array(25))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 96
Function:
SectionEditorSubmissionDAO->_returnSectionEditorSubmissionFromRow(Array(25))
File:
/srv/www/htdocs/pg/pages/sectionEditor/SectionEditorHandler.inc.php line
237
Function:
SectionEditorSubmissionDAO->getSectionEditorSubmission(4792)
File:
/srv/www/htdocs/pg/pages/sectionEditor/SubmissionEditHandler.inc.php
line 49
Function: SectionEditorHandler->validate(4792)
File: (unknown) line (unknown)
Function: SubmissionEditHandler->submission(Array(1),
Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRouter.inc.php line
362
Function: call_user_func(Array(2), Array(1), Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPPageRouter.inc.php
line 220
Function:
PKPRouter->_authorizeInitializeAndCallRequest(Array(2),
Object(Request), Array(1), False)
File: /srv/www/htdocs/pg/lib/pkp/classes/core/Dispatcher.inc.php line
134
Function: PKPPageRouter->route(Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php
line 178
Function: Dispatcher->dispatch(Object(Request))
File: /srv/www/htdocs/pg/index.php line 70
Function: PKPApplication->execute()
Server info:
OS: Linux
PHP Version: 5.4.45-0+deb7u2
Apache Version: Apache/2.2.22 (Debian)
DB Driver: mysql
DB server version: 5.5.38-0+wheezy1

ojs2 has produced an error
Message: WARNING: Illegal string offset ‘pt_BR’
In file: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php
At line: 135
Stacktrace:
File: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php line
135
Function: PKPApplication->errorHandler(2, “Illegal string offset
‘pt_BR’”, “/srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php”,
135, Array(3))
File: /srv/www/htdocs/pg/lib/pkp/classes/db/DAO.inc.php line 565
Function: DataObject->setData(“discipline”, “Ciências
Agrárias; Tecnologia de Alimentos”, “pt_BR”)
File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 234
Function: DAO->getDataObjectSettings(“article_settings”,
“article_id”, “4792”, Object(SectionEditorSubmission))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 114
Function:
ArticleDAO->_articleFromRow(Object(SectionEditorSubmission),
Array(25))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 96
Function:
SectionEditorSubmissionDAO->_returnSectionEditorSubmissionFromRow(Array(25))
File:
/srv/www/htdocs/pg/pages/sectionEditor/SectionEditorHandler.inc.php line
237
Function:
SectionEditorSubmissionDAO->getSectionEditorSubmission(4792)
File:
/srv/www/htdocs/pg/pages/sectionEditor/SubmissionEditHandler.inc.php
line 49
Function: SectionEditorHandler->validate(4792)
File: (unknown) line (unknown)
Function: SubmissionEditHandler->submission(Array(1),
Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRouter.inc.php line
362
Function: call_user_func(Array(2), Array(1), Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPPageRouter.inc.php
line 220
Function:
PKPRouter->_authorizeInitializeAndCallRequest(Array(2),
Object(Request), Array(1), False)
File: /srv/www/htdocs/pg/lib/pkp/classes/core/Dispatcher.inc.php line
134
Function: PKPPageRouter->route(Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php
line 178
Function: Dispatcher->dispatch(Object(Request))
File: /srv/www/htdocs/pg/index.php line 70
Function: PKPApplication->execute()
Server info:
OS: Linux
PHP Version: 5.4.45-0+deb7u2
Apache Version: Apache/2.2.22 (Debian)
DB Driver: mysql
DB server version: 5.5.38-0+wheezy1

ojs2 has produced an error
Message: WARNING: Illegal string offset ‘pt_BR’
In file: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php
At line: 135
Stacktrace:
File: /srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php line
135
Function: PKPApplication->errorHandler(2, “Illegal string offset
‘pt_BR’”, “/srv/www/htdocs/pg/lib/pkp/classes/core/DataObject.inc.php”,
135, Array(3))
File: /srv/www/htdocs/pg/lib/pkp/classes/db/DAO.inc.php line 565
Function: DataObject->setData(“title”, “Processos e substratos
para produção de vinagres: uma revisão”, “pt_BR”)
File: /srv/www/htdocs/pg/classes/article/ArticleDAO.inc.php line 234
Function: DAO->getDataObjectSettings(“article_settings”,
“article_id”, “4792”, Object(SectionEditorSubmission))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 114
Function:
ArticleDAO->_articleFromRow(Object(SectionEditorSubmission),
Array(25))
File:
/srv/www/htdocs/pg/classes/submission/sectionEditor/SectionEditorSubmissionDAO.inc.php
line 96
Function:
SectionEditorSubmissionDAO->_returnSectionEditorSubmissionFromRow(Array(25))
File:
/srv/www/htdocs/pg/pages/sectionEditor/SectionEditorHandler.inc.php line
237
Function:
SectionEditorSubmissionDAO->getSectionEditorSubmission(4792)
File:
/srv/www/htdocs/pg/pages/sectionEditor/SubmissionEditHandler.inc.php
line 49
Function: SectionEditorHandler->validate(4792)
File: (unknown) line (unknown)
Function: SubmissionEditHandler->submission(Array(1),
Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRouter.inc.php line
362
Function: call_user_func(Array(2), Array(1), Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPPageRouter.inc.php
line 220
Function:
PKPRouter->_authorizeInitializeAndCallRequest(Array(2),
Object(Request), Array(1), False)
File: /srv/www/htdocs/pg/lib/pkp/classes/core/Dispatcher.inc.php line
134
Function: PKPPageRouter->route(Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php
line 178
Function: Dispatcher->dispatch(Object(Request))
File: /srv/www/htdocs/pg/index.php line 70
Function: PKPApplication->execute()
Server info:
OS: Linux
PHP Version: 5.4.45-0+deb7u2
Apache Version: Apache/2.2.22 (Debian)
DB Driver: mysql
DB server version: 5.5.38-0+wheezy1

ojs2 has produced an error
Message: WARNING: Cannot modify header information - headers already
sent by (output started at
/srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php:381)
In file: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRequest.inc.php
At line: 87
Stacktrace:
File: (unknown) line (unknown)
Function: PKPApplication->errorHandler(2, “Cannot modify header
information - headers already sent by (output started at
/srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php:381)”,
“/srv/www/htdocs/pg/lib/pkp/classes/core/PKPRequest.inc.php”, 87,
Array(1))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRequest.inc.php line
87
Function: header(“Location: https://200.134.17.36/IT2/editor”)
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRequest.inc.php line
693
Function:
PKPRequest->redirectUrl(“https://200.134.17.36/IT2/editor”)
File:
/srv/www/htdocs/pg/pages/sectionEditor/SectionEditorHandler.inc.php line
288
Function: PKPRequest->redirect(Null, “editor”)
File:
/srv/www/htdocs/pg/pages/sectionEditor/SubmissionEditHandler.inc.php
line 49
Function: SectionEditorHandler->validate(4792)
File: (unknown) line (unknown)
Function: SubmissionEditHandler->submission(Array(1),
Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPRouter.inc.php line
362
Function: call_user_func(Array(2), Array(1), Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPPageRouter.inc.php
line 220
Function:
PKPRouter->_authorizeInitializeAndCallRequest(Array(2),
Object(Request), Array(1), False)
File: /srv/www/htdocs/pg/lib/pkp/classes/core/Dispatcher.inc.php line
134
Function: PKPPageRouter->route(Object(Request))
File: /srv/www/htdocs/pg/lib/pkp/classes/core/PKPApplication.inc.php
line 178
Function: Dispatcher->dispatch(Object(Request))
File: /srv/www/htdocs/pg/index.php line 70
Function: PKPApplication->execute()
Server info:
OS: Linux
PHP Version: 5.4.45-0+deb7u2
Apache Version: Apache/2.2.22 (Debian)
DB Driver: mysql
DB server version: 5.5.38-0+wheezy1

`

I’m sorry for insisting on this, but considering that this is an error from the OJS installation which we are exporting the journal and that it happens on OJS itself (browsing) do you agree that this an OJS problem @asmecher ?

If so, what can i do to give more debug information?

Hi @samueloph,

Can you check your installation to see if there are any entries in the article_settings table for which setting_name='abstract' and locale is either null or blank?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

Yes, i can confirm there are two entries like that, both from the problematic articles, how could i fix that? Would changing for pt_BR fix correctly?

There are also some fields with null locale from the same two articles which i believe are problematic too, they are: cleanTitle, discipline, title, biography and competingInterests.

I gonna try to change their locale values to pt_BR to see if it helps, but i would like you to confirm if this is the correct approach and if you have a hint on why this happened. I believe nobody messed with the DB, could this be something related to old OJS versions that was carried with upgrades?

edit->I can confirm that setting the locale of those fields as pt_BR no more causes error when importing the journal, but i’m still not sure that this fixes the whole problematic submissions, i will make further analysis because these two submissions doesn’t appear when i search for submitted articles with their titles.

Just another quick update,

Setting the locale to those two submissions worked, they didn’t appear on the search for submitted articles because the submissions were incomplete, now i can erase them and import the journal flawlessly.

Thanks @asmecher.

Hi @samueloph,

Great, glad to hear it’s working. I’m still not sure where that incomplete/inconsistent data would come from, but I suspect it’s probably something to do with some quirk of the upgrade history; I haven’t heard of this happening e.g. within our hosted holdings.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi all,

I also encounter this illegal string offset error in a multilingual OJS3 install which was migrated from OJS2 and previously used a lot the import/export plugin.
I looked thorugh the user_settings and author_settings tables as suggested in the other thread and there seemed to be no problems.
However, in the submission_file_settings table there are some rows which have blanks in the locale field and the setting_name is old-supp-id for all these rows. May this cause the error?

Thanks.

Hi @czirfusz,

It’s OK for some settings to have blank locale entries. It all depends on what the code is expecting for that particular setting name. I would suggest trying to track down the setting name for which the illegal string offset warning is appearing.

Regards,
Alec Smecher
Public Knowledge Project Team