[OJS3.4.0-4] PHP Fatal error: Uncaught TypeError: ksort(): Argument #1 ($array) must be of type array, null given in

OJS-3.4.0-4
PHP-8.1

Upgrade from OJS-3.3.0-14 to the OJS-3.4.0-4 version.
For some older submissions, we are not able to notify the author about the decision as on clicking the Request Revisions/Accept Submission/Decline Submission, it gives an error message as given below.

This page isn’t working
epubs.icar.org.in is currently unable to handle this request.
HTTP ERROR 500

PHP Fatal error:  Uncaught TypeError: ksort(): Argument #1 ($array) must be of type array, null given in /ojs/lib/pkp/classes/mail/traits/ReviewerComments.php:125
Stack trace:
#0 /ojs/lib/pkp/classes/mail/traits/ReviewerComments.php(125): ksort()
#1 /ojs/lib/pkp/classes/mail/traits/ReviewerComments.php(85): PKP\mail\mailables\DecisionRequestRevisionsNotifyAuthor->getReviewFormComments()
#2 /ojs/lib/pkp/classes/mail/mailables/DecisionRequestRevisionsNotifyAuthor.php(50): PKP\mail\mailables\DecisionRequestRevisionsNotifyAuthor->setupReviewerCommentsVariable()
#3 /ojs/lib/pkp/classes/decision/types/RequestRevisions.php(149): PKP\mail\mailables\DecisionRequestRevisionsNotifyAuthor->__construct()
#4 /ojs/lib/pkp/pages/decision/DecisionHandler.php(132): PKP\decision\types\RequestRevisions->getSteps()
#5 [internal function]: PKP\pages\decision\DecisionHandler->record()
#6 /ojs/lib/pkp/classes/core/PKPRouter.php(334): call_user_func()
#7 /ojs/lib/pkp/classes/core/PKPPageRouter.php(277): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()
#8 /ojs/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route()
#9 /ojs/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch()
#10 /ojs/index.php(21): PKP\core\PKPApplication->execute()
#11 {main}
  thrown in /ojs/lib/pkp/classes/mail/traits/ReviewerComments.php on line 125

@shantanusingh Do you get the 500 error when you are in the Review stage and requesting revisions? Were you ever able to find a solution?

It sounds like we are having a similar problem with just one submission in OJS 3.4.0.5. The editor is trying to Request Revisions without a second round of review and the next step–https://journals.ku.edu/journalabbr/decision/record/21765?decision=5&reviewRoundId=4373–ends in a blank browser screen showing the URL and a 500 error.

I know that the process works in general in 3.4 because I was able to do it with a submission in my test journal this morning. Any editor is seeing the same behavior with this particular submission. The process does work with other submissions in the same journal.

What’s supposed to happen is that an email form appears that allows the editor to notify the author of the changes that need to be made, followed by another form that allows the editor to inform the reviewers of the decision. I’ve checked the email forms and reset them to defaults so that’s not the problem. ???

It turned out that our error was caused by an author that was Disabled in the system. OJS couldn’t notify them, so it didn’t proceed to the notification step. Ideally, the UI would have told me that without me having to talk to my sysadmin, but instead it just gave the 500 error.

Once I enabled the author, the whole process worked as it should.