Hello!
I am using the git version of OJS (currently 125e2fa468), and the editorial history dialog stopped working for some submissions. When I try to open it, I see the following error in the apache log file:
HP Fatal error: Uncaught Error: Call to a member function getFullName() on null in /var/www/ojs/lib/pkp/classes/user/PKPUserDAO.inc.php:465
Stack trace:
#0 /var/www/ojs/lib/pkp/classes/log/EmailLogEntry.inc.php(129): PKPUserDAO->getUserFullName('0', true)
#1 /var/www/ojs/lib/pkp/controllers/grid/eventLog/EventLogGridCellProvider.inc.php(96): EmailLogEntry->getSenderFullName()
#2 /var/www/ojs/lib/pkp/classes/controllers/grid/GridCellProvider.inc.php(49): EventLogGridCellProvider->getTemplateVarsFromRowColumn(Object(EventLogGridRow), Object(GridColumn))
#3 /var/www/ojs/lib/pkp/classes/controllers/grid/GridHandler.inc.php(1096): GridCellProvider->render(Object(Request), Object(EventLogGridRow), Object(GridColumn))
#4 /var/www/ojs/lib/pkp/classes/controllers/grid/GridHandler.inc.php(1003): GridHandler->_renderCellInternally(Object(Request), Object(EventLogGridRow), Object(GridColumn))
#5 /var/www/ojs/lib/pkp/classes/controllers/grid/GridHandler.inc.php(980): GridHandler->renderRowInternally(Object(Request), Object(EventLogGridRo in /var/www/ojs/lib/pkp/classes/user/PKPUserDAO.inc.php on line 465
How do I further investigate and resolve this issue?
UPDATE
I’ve pinpointed the line that causes the problem. The file lib/pkp/classes/log/EmailLogEntry.inc.php, function getSenderFullName():
function getSenderFullName() {
$senderFullName =& $this->getData('senderFullName');
if(!isset($senderFullName)) {
$userDao = DAORegistry::getDAO('UserDAO');
$senderFullName = $userDao->getUserFullName($this->getSenderId(), true); # This is the line.
}
return ($senderFullName ? $senderFullName : '');
}
If I simply wrap the problematic line in try/catch, everything seems to work fine. Do I need to file a bug report about this?
Yes, I do have a bunch of entries in the email_log table where the sender_id is 0. These entries were probably corrupted when I ran the upgrade.php script after migrating from 3.1.1 to the git version of OJS. How do I make sure this does not happen in the future?
Ok, I’ll just hope that it will work from now on, then. I removed the try/catch that I added earlier, fixed those entries, and it seems to have resolved the issue. Thank you for the great work and for your help with this. Have a great day!
I have the same issue but only in one manuscript. How can I solve the issue? I try with the query and I found 131 rows, but I don’t know what need to do now…
This looks like a data error. Apparently you have an entry in notes with assoc_type = 1048586 (ASSOC_TYPE_QUERY) and an assoc_id that refers to a non-existent query_id in the queries table.
Regards,
Alec Smecher
Public Knowledge Project Team
Hm, that’s quite a few. Essentially when you create a new discussion (“query” in code terms), it also creates a note that contains its subject and contents. (Further comments are added as new notes.) The assoc_type/assoc_id combination in the notes table indicates that the notes are attached to queries (assoc_type=1048586) and the assoc_id indicates which query (referring to the query_id in the queries table).
I’m not sure how you would end up with 100 notes that refer to non-existent queries. Do you know if there was some manual intervention in the database? Are you able to replicate this behavior e.g. by somehow creating a 101st case?
Regards,
Alec Smecher
Public Knowledge Project Team