Skip to content
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

Data too long for column 'original_file_name' #32

Open
ajnyga opened this issue Dec 4, 2024 · 4 comments
Open

Data too long for column 'original_file_name' #32

ajnyga opened this issue Dec 4, 2024 · 4 comments

Comments

@ajnyga
Copy link
Owner

ajnyga commented Dec 4, 2024

Encountered this for the first time. For some reason it was not triggered in our test server, only in production.

PHP Fatal error:  Uncaught Exception: DB Error: Data too long for column 'original_file_name' at row 1 Query: INSERT INTO submission_files
                (revision, submission_id, source_file_id, source_revision, file_type, file_size, original_file_name, file_stage, date_uploaded, date_modified, viewable, uploader_user_id, assoc_type, assoc_id, genre_id, direct_sales_price, sales_type)
                VALUES
                (?, ?, ?, ?, ?, ?, ?, ?, '2024-12-04 14:07:36', '2024-12-04 14:07:36', ?, ?, ?, ?, ?, ?, ?) in /var/www/www.journal.fi/public_html/lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), 'INSERT INTO sub...')
#1 public_html/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php(72): DAO->update('INSERT INTO sub...', Array)
#2 lib/pkp/classes/submission/SubmissionFileDAO.inc.php(313): SubmissionFileDAODelegate->insertObject(Object(SubmissionFile), '/var/www/www.jo...', fal in public_html/lib/pkp/classes/db/DAO.inc.php on line 703

Data causing the problem:
<name locale="en_US">SKY_JoL_2000_12_communication_grammar_and_grammaticalization_aspects_on_the_grammaticalization_of_the_construction_vera_búinn_ad_infinitive_in_contemporary_icelandic.pdf</name>

@ajnyga
Copy link
Owner Author

ajnyga commented Dec 4, 2024

Two things that might be affecting this:
ú in the string?
The fact that it is just too long...

Questions:
Does this still affect more recent versions of OJS?
If yes, we probably have to validate the length of the filename

@ronste
Copy link
Collaborator

ronste commented Dec 5, 2024

Hi @ajnyga,

it seems you are working with OJS 3.2. As far as I can see the field 'original_file_name' has been removed from 'submission_files' in OJS 3.3.

However, the table 'issue_files' still has a field 'original_file_name' the length of which is hard-coded as 127. For other such filenames I also found hard-coded values of 255. Even in the current (3.5) main Branch.

None of these restrictions are reflected in the XSDs. So they can not be validated. Maybe we should ask PKP what the long term plans are for this field and generally about restrictions of string lenghts. If we could agree on a fixed value it would be easy for us to handle.

@ajnyga
Copy link
Owner Author

ajnyga commented Dec 5, 2024

yeah, that was for 3.2 and had a feeling this might not affect newer versions

@ajnyga ajnyga closed this as completed Dec 5, 2024
@ajnyga ajnyga reopened this Dec 5, 2024
@ajnyga
Copy link
Owner Author

ajnyga commented Dec 5, 2024

Probably a good idea to collect all "fix this in the OJS end" issues to one and present them to PKP. In some could also contribute for the fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants