rvdb
January 20, 2026, 2:11pm
1
Describe the issue or problem
In OJS-3.5.0-3, in the Review Details modal, selecting the download format “Editor Form Shows All Review Sections (PDF)” often leads to following error: in_array(): Argument #2 ($haystack) must be of type array, null given.
I’m suspecting this is happening only for reviews that don’t have any values in “editor-only” fields that haven’t been marked as “Included in message to author” in the review form. See screenshots below.
Steps I took leading up to the issue
Go to the “Review” tab for an article
In the “Reviewers” section, click “Review Details”
In the review modal, open the “Download Review Form” menu, and select “Editor Form Shows All Review Sections (PDF)”
If the review doesn’t have any responses for fields that haven’t been marked as “Included in message to author” in the review form, this will fail with a in_array(): Argument #2 ($haystack) must be of type array, null given error.
What application are you using?
For example, OJS 3.5.0-3
Additional information
The download format:
The error message:
The determining factor, apparently: the review has no responses for fields that have been marked as “Included in message to author” in the review form:
Hi @rvdb ,
Can you check your PHP error log to find the full error message? It should include the text in the screenshot above, but also information about where in the code the error occurred.
Thanks,
Alec Smecher
Public Knowledge Project Team
rvdb
January 22, 2026, 9:17pm
4
Hi @asmecher ,
Sure, that’s:
172.26.0.9 - - [22/Jan/2026:21:06:36 +0000] "GET /index.php/journal/api/v1/reviews/305/773/export-pdf?authorFriendly=0 HTTP/1.1" 500 337 "https://journal.com/index.php/journal/dashboard/editorial?currentViewId=assigned-to-me&workflowSubmissionId=305&workflowMenuKey=workflow_3_265" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0"
[Thu Jan 22 21:06:38.349012 2026] [php:notice] [pid 15:tid 15] [client 172.26.0.9:37514] TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /var/www/html/cache/t_compile/f47c667ee81e2a99a49d60f91a0f1326d2ec59cc^c3f52befe2a6d33da059c435037f3de225251e7c_0.app.controllersgridusersreviewerreviewDownload.tpl.php:116
Stack trace:
#0 /var/www/html/cache/t_compile/f47c667ee81e2a99a49d60f91a0f1326d2ec59cc^c3f52befe2a6d33da059c435037f3de225251e7c_0.app.controllersgridusersreviewerreviewDownload.tpl.php(116): in_array()
#1 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_696eb903b69235_33820476()
#2 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#3 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()
#4 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()
#5 /var/www/html/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#6 /var/www/html/lib/pkp/classes/template/PKPTemplateManager.php(1286): Smarty_Internal_TemplateBase->fetch()
#7 /var/www/html/lib/pkp/api/v1/reviews/PKPReviewController.php(399): PKP\\template\\PKPTemplateManager->fetch()
#8 /var/www/html/lib/pkp/api/v1/reviews/PKPReviewController.php(423): PKP\\API\\v1\\reviews\\PKPReviewController->generatePDF()
#9 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/CallableDispatcher.php(40): PKP\\API\\v1\\reviews\\PKPReviewController->exportReviewPDF()
#10 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Route.php(244): Illuminate\\Routing\\CallableDispatcher->dispatch()
#11 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Route.php(215): Illuminate\\Routing\\Route->runCallable()
#12 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Router.php(808): Illuminate\\Routing\\Route->run()
#13 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(170): Illuminate\\Routing\\Router->{closure:Illuminate\\Routing\\Router::runRouteWithinStack():807}()
#14 /var/www/html/lib/pkp/classes/middleware/HasRoles.php(75): Illuminate\\Pipeline\\Pipeline->{closure:Illuminate\\Pipeline\\Pipeline::prepareDestination():168}()
#15 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\HasRoles->handle()
#16 /var/www/html/lib/pkp/classes/middleware/HasRoles.php(75): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#17 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\HasRoles->handle()
#18 /var/www/html/lib/pkp/classes/middleware/HasContext.php(35): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#19 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\HasContext->handle()
#20 /var/www/html/lib/pkp/classes/middleware/HasUser.php(35): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#21 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\HasUser->handle()
#22 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(127): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#23 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then()
#24 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Router.php(786): Illuminate\\Routing\\Router->runRouteWithinStack()
#25 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Router.php(750): Illuminate\\Routing\\Router->runRoute()
#26 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Routing/Router.php(739): Illuminate\\Routing\\Router->dispatchToRoute()
#27 /var/www/html/lib/pkp/classes/handler/APIHandler.php(104): Illuminate\\Routing\\Router->dispatch()
#28 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(170): PKP\\handler\\APIHandler->{closure:PKP\\handler\\APIHandler::runRoutes():103}()
#29 /var/www/html/lib/pkp/classes/middleware/PolicyAuthorizer.php(109): Illuminate\\Pipeline\\Pipeline->{closure:Illuminate\\Pipeline\\Pipeline::prepareDestination():168}()
#30 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\PolicyAuthorizer->handle()
#31 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#32 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#33 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#34 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#35 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#36 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#37 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#38 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): Illuminate\\Http\\Middleware\\ValidatePostSize->handle()
#39 /var/www/html/lib/pkp/classes/middleware/ValidateCsrfToken.php(55): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#40 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\ValidateCsrfToken->handle()
#41 /var/www/html/lib/pkp/classes/middleware/DecodeApiTokenWithValidation.php(76): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#42 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\DecodeApiTokenWithValidation->handle()
#43 /var/www/html/lib/pkp/classes/middleware/SetupContextBasedOnRequestUrl.php(63): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#44 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\SetupContextBasedOnRequestUrl->handle()
#45 /var/www/html/lib/pkp/classes/middleware/AllowCrossOrigin.php(34): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#46 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(209): PKP\\middleware\\AllowCrossOrigin->handle()
#47 /var/www/html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(127): Illuminate\\Pipeline\\Pipeline->{closure:{closure:Illuminate\\Pipeline\\Pipeline::carry():184}:185}()
#48 /var/www/html/lib/pkp/classes/handler/APIHandler.php(103): Illuminate\\Pipeline\\Pipeline->then()
#49 /var/www/html/lib/pkp/classes/c
Best,
Ron
Hi @rvdb ,
At a glance, this change (applied in lib/pkp) should take care of it:
diff --git a/templates/controllers/grid/users/reviewer/reviewDownload.tpl b/templates/controllers/grid/users/reviewer/reviewDownload.tpl
index 21a05782ea..119906d7cc 100644
--- a/templates/controllers/grid/users/reviewer/reviewDownload.tpl
+++ b/templates/controllers/grid/users/reviewer/reviewDownload.tpl
@@ -74,7 +74,7 @@
<div class="section">
{foreach from=$possibleResponses key=key item=possibleResponse}
<div>
- <input type="checkbox" {if in_array($key, $reviewFormCheckboxResponses)}checked="1"{/if}>
+ <input type="checkbox" {if is_array($reviewFormCheckboxResponses) && in_array($key, $reviewFormCheckboxResponses)}checked="1"{/if}>
<span>{$possibleResponse|escape}</span>
</div>
{/foreach}
Could you try this change and report back?
Thanks,
Alec Smecher
Public Knowledge Project Team
rvdb
January 28, 2026, 11:10pm
6
Hi @asmecher ,
Thank you very much; I’ve applied the patch and can confirm this fixes the issue.
Best,
Ron
Hi @rvdb ,
Thanks for the quick confirmation! I’ve filed that and merged it for release in the next 3.5.0-x build here .
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
Closed
February 2, 2026, 4:00pm
8
This topic was automatically closed after 10 days. New replies are no longer allowed.