Jquery.min.js 500 error - 3.4.0-3

The notifications dont want to load:

jquery.min.js?v=3.4.0.3:2 GET /index.php/journal/$$$call$$$/grid/notifications/task-notifications-grid/fetch-grid?_=1693652002801 500

As there are two jquery files and both of them are accessible and there are no other instances in the error log I am somewhat at a loss. Any pointers are welcome.

Hi @Zarevac,

Can you please indicate which version you’re working from (e.g. 3.3.0-13)? In the future, please include this information in your posts as it assists others with troubleshooting.

Thanks,

Roger
PKP Team

Oops my bad, the latest version. I thought it was obvious due to the marking in the js file.

Hi @Zarevac,

No worries - I just noted it in the title of the post and we’ll see if one of our developers can look at this when they are available.

Best regards,

Roger
PKP Team

1 Like

Hi @rcgillis ,

I did some digging and found this:

[05-Sep-2023 07:43:37 UTC] PHP Fatal error: Uncaught Error: Call to a member function getLocalizedTitle() on null in /lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.php:187 Stack trace: #0 /lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.php(63): PKP\controllers\grid\notifications\NotificationsGridCellProvider->_getTitle(Object(APP\notification\Notification)) #1 /lib/pkp/classes/controllers/grid/GridCellProvider.php(66): PKP\controllers\grid\notifications\NotificationsGridCellProvider->getCellActions(Object(APP\core\Request), Object(PKP\controllers\grid\GridRow), Object(PKP\controllers\grid\GridColumn)) #2 /lib/pkp/classes/controllers/grid/GridHandler.php(1262): PKP\controllers\grid\GridCellProvider->render(Object(APP\core\Request), Object(PKP\controllers\grid\GridRow), Object(PKP\controllers\grid\GridColumn)) #3 /lib/pkp/classes/controllers/grid/GridHandler.php(1163): PKP\controllers\grid\GridHandler->_renderCellInternally(Object(APP\core\Request), Object(PKP\controllers\grid\GridRow), Object(PKP\controllers\grid\GridColumn)) #4 /lib/pkp/classes/controllers/grid/GridHandler.php(1138): PKP\controllers\grid\GridHandler->renderRowInternally(Object(APP\core\Request), Object(PKP\controllers\grid\GridRow)) #5 /lib/pkp/classes/controllers/grid/GridHandler.php(1188): PKP\controllers\grid\GridHandler->renderRowsInternally(Object(APP\core\Request), Array) #6 /lib/pkp/classes/controllers/grid/GridHandler.php(1063): PKP\controllers\grid\GridHandler->renderGridBodyPartsInternally(Object(APP\core\Request)) #7 /lib/pkp/classes/controllers/grid/GridHandler.php(735): PKP\controllers\grid\GridHandler->doSpecificFetchGridActions(Array, Object(APP\core\Request), Object(APP\template\TemplateManager)) #8 [internal function]: PKP\controllers\grid\GridHandler->fetchGrid(Array, Object(APP\core\Request)) #9 /lib/pkp/classes/core/PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request)) #10 /lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array) #11 /lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route(Object(APP\core\Request)) #12 /lib/pkp/classes/core/PKPApplication.php(387): PKP\core\Dispatcher->dispatch(Object(APP\core\Request)) #13 /index.php(21): PKP\core\PKPApplication->execute() #14 {main} thrown in /lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.php on line 187

@rcgillis Could you also forward to the developers that this error only occurs with the admin account.

Greetings, it has been a while since this post but the error persisted and I had some time to kill and fix it. So the error is in short as follows. I couldn’t open the notifications in my admin account for some reason throwing Jquery error. After checking the log I found this error:

{main}
  thrown in /lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.php on line 187

The original code states this:

if (!isset($submissionId) && isset($fileId)) {
    assert(is_numeric($fileId));
    $submissionFile = Repo::submissionFile()->get($fileId);
    assert($submissionFile instanceof \PKP\submissionFile\SubmissionFile);
    $submissionId = $submissionFile->getData('submissionId');
}
assert(is_numeric($submissionId));
$submission = Repo::submission()->get($submissionId);
assert($submission instanceof \APP\submission\Submission);

return $submission->getLocalizedTitle();

I replaced it with this code:

if (!isset($submissionId) && isset($fileId)) {
    assert(is_numeric($fileId));
    $submissionFile = Repo::submissionFile()->get($fileId);
    assert($submissionFile instanceof \PKP\submissionFile\SubmissionFile);
    $submissionId = $submissionFile->getData('submissionId');
}
assert(is_numeric($submissionId));
$submission = Repo::submission()->get($submissionId);

// Enhanced error handling
if (!$submission) {
    error_log("Error: Submission not found for ID $submissionId.");
    return 'Submission not found';
}

if (!$submission instanceof \APP\submission\Submission) {
    error_log("Error: Submission object is not of the expected type for ID $submissionId.");
    return 'Invalid submission type';
}

return $submission->getLocalizedTitle();

This resolved the issue and I can now open my notifications in the admin account.

1 Like

This topic was automatically closed after 10 days. New replies are no longer allowed.