mcmeira
Outubro 19, 2022, 6:11pm
#1
Erro na etapa de edição de texto ao selecionar arquivo para enviar
No final da tela de Edição de Texto, ao clicar no Botão “Enviar/ Selecionar Arquivo”, a janela exibida fica “Carregando” e não mostra os arquivos já tratados na submissão, para selecionar e dar continuidade no processo.
Esta situação só ocorre para uma submissão específica. O mesmo comportamento (só fica carregando) também ocorre ao clicar no “Histórico de Atividades”
versão do sistema 3.3.0-8
perfil Administrador e Editor
link público do portal de periódicos . revista.mpdft.mp.br
logs do servidor ABAIXO:
[Tue Oct 18 14:01:31.980569 2022] [php7:error] [pid 16074] [client 10.34.224.254:58961] PHP Fatal error: Uncaught Error: Call to a member function getAssocId() on null in /var/www/html/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php:131\nStack trace:\n#0 /var/www/html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(402): SubmissionFilesCategoryGridDataProvider->loadCategoryData()\n#1 /var/www/html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(124): CategoryGridHandler->loadCategoryData()\n#2 /var/www/html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(473): CategoryGridHandler->getGridCategoryDataElements()\n#3 /var/www/html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(453): CategoryGridHandler->_renderCategoryInternally()\n#4 /var/www/html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(276): CategoryGridHandler->_renderCategoriesInternally()\n#5 /var/www/html/lib/pkp/classes/controllers/grid/GridHandler.inc.php(643): CategoryGridHandler->doSpecificFetchGridActions()\n#6 /var/www/html/lib/pkp/classes/core/PKPRouter.inc in /var/www/html/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php on line 131, referer: Acesso | Revista do Ministério Público do Distrito Federal e Territórios
Prezado @mcmeira ,
Aparentemente são dois bugs já relatados na comunidade do PKP.
Para resolver o problema de erro no log do histórico, é só aplicar esse commit:
pkp/pkp-lib#7453 Fix activity log won't open when query note deleted by NateWr · Pull Request #7457 · pkp/pkp-lib · GitHub
Com relação ao problema do texto editado na etapa de “Edição de Texto” , aparentemente resolve aplicando a consulta SQL e deletando registros órfãos, conforme a discussão a seguir:
opened 02:26PM - 24 Jun 21 UTC
in my case Copyediting it is not possible to use “Upload/Select Files” from Copy… editing stage.
It happens that the window opens but does not load the part for uploading or selecting files.

**this is exactly the same case with https://github.com/pkp/pkp-lib/issues/4754 but it is not solved by the method there. The file revision is already done in our OJS 3.3.0-6 system. in other words, the given solution was already applied to the related files, but the problem still exists.
we are using php 7.4.**
the related error log was:
Stack trace:
#0 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(402): SubmissionFilesCategoryGridDataProvider->loadCategoryData(Object(Request), 4, Array)
#1 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(124): CategoryGridHandler->loadCategoryData(Object(Request), 4, Array)
#2 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(473): CategoryGridHandler->getGridCategoryDataElements(Object(Request), 4)
#3 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(453): CategoryGridHandler->_renderCategoryInternally(Object(Request), Object(SelectableSubmissionFileListCategoryGridRow))
#4 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc. in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php on line 131
[24-Jun-2021 16:59:33 Europe/Istanbul] PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, ...$functionArgs) in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33
[24-Jun-2021 16:59:58 Europe/Istanbul] PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, ...$functionArgs) in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33
[24-Jun-2021 16:59:59 Europe/Istanbul] PHP Fatal error: Uncaught Error: Call to a member function getAssocId() on null in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php:131
Stack trace:
**the problem seems to be related with SubmissionFilesCategoryGridDataProvider.inc.php on line 131.
then without any knowledge I edited the code using two lines I found on internet**
**before code was like that:**
$submissionFiles = $this->_submissionFiles;
$stageSubmissionFiles = array();
foreach ($submissionFiles as $key => $submissionFile) {
if (in_array($submissionFile->getData('fileStage'), (array) $fileStage)) {
$stageSubmissionFiles[$key] = $submissionFile;
} elseif ($submissionFile->getData('fileStage') == SUBMISSION_FILE_QUERY) {
// Determine the stage from the query.
if ($submissionFile->getData('assocType')!=ASSOC_TYPE_NOTE) break;
$noteDao = DAORegistry::getDAO('NoteDAO'); /* @var $noteDao NoteDAO */
$note = $noteDao->getById($submissionFile->getData('assocId'));
assert($note && $note->getAssocType()==ASSOC_TYPE_QUERY);
$queryDao = DAORegistry::getDAO('QueryDAO'); /* @var $queryDao QueryDAO */
$query = $queryDao->getById($note->getAssocId());
if ($query && $query->getStageId() == $stageId) $stageSubmissionFiles[$key] = $submissionFile;
}
}
}
return $dataProvider->prepareSubmissionFileData($stageSubmissionFiles, false, $filter);
**after I add two lines: which are given bold**
$submissionFiles = $this->_submissionFiles;
$stageSubmissionFiles = array();
foreach ($submissionFiles as $key => $submissionFile) {
if (in_array($submissionFile->getData('fileStage'), (array) $fileStage)) {
$stageSubmissionFiles[$key] = $submissionFile;
} elseif ($submissionFile->getData('fileStage') == SUBMISSION_FILE_QUERY) {
// Determine the stage from the query.
if ($submissionFile->getData('assocType')!=ASSOC_TYPE_NOTE) break;
$noteDao = DAORegistry::getDAO('NoteDAO'); /* @var $noteDao NoteDAO */
$note = $noteDao->getById($submissionFile->getData('assocId'));
assert($note && $note->getAssocType()==ASSOC_TYPE_QUERY);
$queryDao = DAORegistry::getDAO('QueryDAO'); /* @var $queryDao QueryDAO */
**if (!$submission) error_log('MISSING SUBMISSION ID ' . $submissionId . ': assoc_type ' . $notification->getAssocType() . ' and assoc_id ' . $notification->getAssocId() . '; type ' . $notification->getType());
return $submission->getLocalizedTitle();**
$query = $queryDao->getById($note->getAssocId());
if ($query && $query->getStageId() == $stageId) $stageSubmissionFiles[$key] = $submissionFile;
}
}
}
return $dataProvider->prepareSubmissionFileData($stageSubmissionFiles, false, $filter);
then it worked and I was able to add files to the Copyedited part.
**But I do not know what I have done**
**Is it something bad and get more problems to me. How should I edit the code to be OK?**
after my code editing related error log is:
Stack trace:
#0 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(402): SubmissionFilesCategoryGridDataProvider->loadCategoryData(Object(Request), 4, Array)
#1 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(124): CategoryGridHandler->loadCategoryData(Object(Request), 4, Array)
#2 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(473): CategoryGridHandler->getGridCategoryDataElements(Object(Request), 4)
#3 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(453): CategoryGridHandler->_renderCategoryInternally(Object(Request), Object(SelectableSubmissionFileListCategoryGridRow))
#4 /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc. in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php on line 133
[24-Jun-2021 17:02:10 Europe/Istanbul] PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, ...$functionArgs) in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33
[24-Jun-2021 17:02:10 Europe/Istanbul] PHP Warning: Invalid argument supplied for foreach() in /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/GridHandler.inc.php on line 981
[24-Jun-2021 17:03:59 Europe/Istanbul] PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, ...$functionArgs) in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33
[24-Jun-2021 17:04:00 Europe/Istanbul] PHP Warning: Invalid argument supplied for foreach() in /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/GridHandler.inc.php on line 981
[24-Jun-2021 17:04:41 Europe/Istanbul] PHP Warning: Invalid argument supplied for foreach() in /home/sappear1/public_html/sts/lib/pkp/classes/controllers/grid/GridHandler.inc.php on line 981
[24-Jun-2021 17:04:44 Europe/Istanbul] PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, ...$functionArgs) in /home/sappear1/public_html/sts/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33
[24-Jun-2021 17:07:02 Europe/Istanbul] ojs2: 404 Not Found
Verifique essas soluções e nos dê o feedback.
Atenciosamente,
@diegojmacedo
1 curtida
mcmeira
Outubro 19, 2022, 8:40pm
#3
@diegojmacedo , deu certo, muito obrigado.
2 curtidas