Describe the issue or problem
I am trying to add a custom grid in OJS 3.4.0-7, which displays reviewer responses. The grid includes a column with a “View Response” action that should open a modal. However, clicking on the “View Response” action results in a 404 error. I have confirmed that the handler for the action is registered and the route is set up correctly, but the system fails to locate it. I expected the modal to load with content from the readReview
method in my handler.
Steps I took leading up to the issue
- Created a custom grid handler named
ReviewerResponseGridHandler
in the namespacePKP\controllers\grid\reviewerResponses
. - Defined the
readReview
method in theReviewerResponseGridHandler
to handle the action. - Added a custom
ReviewerResponsesGridCellProvider
for handling cell actions. - Configured the grid to include a “View Response” column with an
AjaxModal
action. - Loaded the grid and clicked “View Response.”
Here is the relevant portion of the cell provider code for generating the action:
public function getCellActions($request, $row, $column, $position = GridHandler::GRID_ACTION_POSITION_DEFAULT)
{
$router = $request->getRouter();
$actionArgs = $this->getRequestArgs($row);
switch ($column->getId()) {
case 'viewResponse':
return [new LinkAction(
'readReview',
new AjaxModal(
$router->url($request, null, 'grid.reviewerResponses.ReviewerResponseGridHandler', 'readReview', null, $actionArgs),
__('grid.action.view'),
'modal_view'
),
__('grid.action.view'),
'view'
)];
}
return parent::getCellActions($request, $row, $column, $position);
}
Here is the readReview
method in the grid handler:
public function readReview($args, $request)
{
error_log("readReview method called.");
return new JSONMessage(true, "Test content for modal.");
}
What application are you using?
OJS 3.4.0-7
Additional information
- The
ReviewerResponseGridHandler
is located inPKP\controllers\grid\reviewerResponses
. - I verified that the route resolves correctly in the logs. However, the 404 persists when clicking the action.
- The debug logs show that the
fetchGrid
call works correctly, and the data loads into the grid as expected. - I also added inside the addRoleAssignment() function the ‘readReview’ function.
- Here’s the error I see in the logs when clicking the “View Response” action:
404 Not Found: Unable to resolve the handler for the action 'readReview'. Failed Ajax request or invalid JSON returned.
- I suspect there may be an issue with how the route is being resolved or the handler registration.
Please let me know if I need to provide additional information or code snippets. Thank you!