pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
307 stars 447 forks source link

Unable to access the Editorial History after upgrade to OJS 3.1.2 #4674

Closed gonetil closed 5 years ago

gonetil commented 5 years ago

We have upgraded from OJS 3.1.1.2 to OJS 3.1.2 . After the upgrade, in some articles from some journals we cannot access to the Editorial History popup (it hangs on loading forever). It does not happend with all journals, neither with all articles from affected journals.

We have found many entries like these in the logs:

[Thu Apr 11 14:01:35.552359 2019] [:error] [pid 15735] [client ---] FastCGI: server "/usr/lib/cgi-bin/php7-fcgi-revistas-ssl" stderr: PHP message: PHP Fatal error: Uncaught Error: Call to a member function getFullName() on null in /var/www/ojs/lib/pkp/classes/user/UserDAO.inc.php:465, referer: https://revistas.unlp.edu.ar/raab/workflow/index/5154/5

It seems some events, all of them related to emails (an email has been sent, an automatic reminder has been sent...), do not have a valid user_id (zero). I have patched temporarily that class by changing the line 465 of /lib/pkp/classes/user/UserDAO.inc.php with this: return ($user) ? $user->getFullName() : " - ";

so now we see a "-" when there is no user for the event (see image below). But off course this is not a real solution, we should see if anyone else has had the same issue after upgrading.

editorial history

asmecher commented 5 years ago

@gonetil, you can resolve this by applying this patch: https://github.com/pkp/pkp-lib/commit/8156b1e6e7765bf4b35307b7872af5242c2f466e

This fix will be included in the OJS 3.1.2-1 release, which I will schedule shortly.

mpbraendle commented 5 years ago

@asmecher Hi Alec, although I have fixed our installation with the patch above, there seem to exist followup errors. It happens when the submission list of a specific journal is loaded:

[28-May-2019 06:00:36 UTC] Slim Application Error: Type: Error Message: Call to a member function getFullName() on null File: /usr/local/service/www/ojs/lib/pkp/classes/submission/reviewAssignment/ReviewAssignmentDAO.inc.php Line: 480 Trace: #0 /usr/local/service/www/ojs/lib/pkp/classes/submission/reviewAssignment/ReviewAssignmentDAO.inc.php(69): ReviewAssignmentDAO->_fromRow(Array)

1 /usr/local/service/www/ojs/lib/pkp/classes/submission/reviewAssignment/ReviewAssignmentDAO.inc.php(217): ReviewAssignmentDAO->_getReviewAssignmentsArray('SELECT r.*, r2....', Array)

2 /usr/local/service/www/ojs/lib/pkp/classes/services/PKPSubmissionService.inc.php(308): ReviewAssignmentDAO->getBySubmissionId('1871')

3 /usr/local/service/www/ojs/lib/pkp/classes/services/PKPSubmissionService.inc.php(652): PKP\Services\PKPSubmissionService->getReviewAssignments(Object(Article))

. . .

Are there any other patches that are related to #4674 ?

asmecher commented 5 years ago

@mpbraendle, this looks like a data error to me. Try running the following database query:

SELECT ra.review_id FROM review_assignments ra LEFT JOIN users u ON (ra.reviewer_id = u.user_id) WHERE u.user_id IS NULL;

If it gives any results, these are review assignments that refer to users who don't exist in the users table. You can reconcile these either by removing the review assignments, or changing the reviewer_id column so it refers to a user account that does exist. (If you have any insight into why this discrepancy exists, please let me know -- e.g. is this old data from OJS 2.x? Are these users that were deleted somehow? etc.)

mpbraendle commented 5 years ago

@asmecher ty for the hint. Yes, this is migrated data from a OJS 2.4.8-4 installation migrated over to OJS 3.1.2. Yes, I had done a large deletion action of spam users before migration. Yes, the SQL query yields 4 rows.

In the meantime, I had added the following patch to lib/pkp/classes/submission/reviewAssignment/ReviewAssignmentDAO.inc.php

Line 480: old: $reviewAssignment->setReviewerFullName($user->getFullName());
new: if ($user) $reviewAssignment->setReviewerFullName($user->getFullName());

Works now without errors.

asmecher commented 5 years ago

@mpbraendle, I'm not sure if there are other places in the system where the data problem will cause errors -- you might well be OK to continue with the change you made, but it might also be worth correcting those rows in the DB. In any case, glad you're back in business.