Hi
Using OJS 3.3.0.8 . In the copyediting stage when I upload a certain file in a certain article then popup for uploading comes and keep loading. Cant upload the file. Where as in other articles i can upload files. The log is this
#0 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(402): SubmissionFilesCategoryGridDataProvider->loadCategoryData(Object(Request), 4, Array)
#1 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(124): CategoryGridHandler->loadCategoryData(Object(Request), 4, Array)
#2 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(473): CategoryGridHandler->getGridCategoryDataElements(Object(Request), 4)
#3 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(453): CategoryGridHandler->_renderCategoryInternally(Object(Request), Object(SelectableSubmissionFileListCategoryGridRow))
#4 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(276): Category in /home/hamdardis/public_html/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php on line 131
[02-Jul-2022 17:18:48 UTC] PHP Warning: Declaration of ManageCopyeditFilesForm::execute($stageSubmissionFiles, $fileStage = NULL) should be compatible with ManageSubmissionFilesForm::execute($stageSubmissionFiles = NULL, $fileStage = NULL, …$functionArgs) in /home/hamdardis/public_html/lib/pkp/controllers/grid/files/copyedit/form/ManageCopyeditFilesForm.inc.php on line 33
[02-Jul-2022 17:18:48 UTC] PHP Fatal error: Uncaught Error: Call to a member function getAssocId() on null in /home/hamdardis/public_html/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php:131
Stack trace:
#0 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(402): SubmissionFilesCategoryGridDataProvider->loadCategoryData(Object(Request), 4, Array)
#1 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(124): CategoryGridHandler->loadCategoryData(Object(Request), 4, Array)
#2 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(473): CategoryGridHandler->getGridCategoryDataElements(Object(Request), 4)
#3 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(453): CategoryGridHandler->_renderCategoryInternally(Object(Request), Object(SelectableSubmissionFileListCategoryGridRow))
#4 /home/hamdardis/public_html/lib/pkp/classes/controllers/grid/CategoryGridHandler.inc.php(276): Category in /home/hamdardis/public_html/lib/pkp/controllers/grid/files/SubmissionFilesCategoryGridDataProvider.inc.php on line 131
Hi @a2usmani
You are probably encountering this issue here:
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
which is fixed with this small modification:
committed 08:10PM - 03 Dec 21 UTC
This is fixed in main and will be part of 3.4
Best
Jason
1 Like