-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submission file with orphaned uploader user ID causes fatal error on submission list loading #8493
Comments
PR: #8501 |
@asmecher, can you review this PR? |
@Vitaliy-1, this is happening because we're getting stricter about type hints (on the PHP side) and null data (in the SQL side), where we previously were very vague on both -- a The $user = Repo::user()->get((int) $submissionFile->getData('uploaderUserId')); If An alternative would be to change the Neither of these ideas will solve our likeliest use case for the general problem, where the ID is being derived from a user-specified string ( (See also: https://wiki.php.net/rfc/nullable-casting) |
@Vitaliy-1, assigning you since this is already underway! |
@asmecher, are you ok with the solution proposed above? I've also updated the submission file schema JSON to make |
Yes, please go ahead! |
#8493 submission's uploaded user ID can be null
Describe the bug
As a part of the migration process, in
submission_files
table,uploader_user_id
is set toNULL
if it's pointing to a non-existing user. This causes a fatal error, see: Vitaliy-1/JATSParserPlugin#80The problem occurs when the submission file schema tries to get a user object from the uploader user ID:
pkp-lib/classes/submissionFile/maps/Schema.php
Line 179 in 3a4dce7
What application are you using?
OJS main branch
The text was updated successfully, but these errors were encountered: