MantisBT: master-2.25 b507ceae

Author Committer Branch Timestamp Parent
dregad dregad master-2.25 2021-10-15 08:40 master-2.25 702a0b85
Affected Issues  0029144: Adding an attachment with a long filename causes "Data too long for column 'filename'" application error
Changeset

Fix "Data too long for column 'filename'" error

Column "filename" in "mantis_bug_file_table" has a limit of 250 chars.
Uploading a file with a name longer than this limit results in
APPLICATION ERROR 401: Database query failed. Error received from
database was #1406: Data too long for column 'filename'.

Adding error handling:

  • set 'maxsize' attribute to input text fields
  • the javascript that validates adding files to dropzone, now provides
    the user with a meaningful error message before they submit the issue
  • in the back-end scripts, throwing a ClientException should allow
    plugins to catch the error and recover
  • a new ERROR_FILE_NAME_TOO_LONG error constant and corresponding error
    string provides a user-friendly message instead of a generic database
    error

Fixes 0029144

mod - core/commands/IssueAddCommand.php Diff File
mod - core/constant_inc.php Diff File
mod - core/file_api.php Diff File
mod - core/print_api.php Diff File
mod - js/common.js Diff File
mod - lang/strings_english.txt Diff File
mod - manage_proj_create_page.php Diff File
mod - manage_proj_edit_page.php Diff File
mod - proj_doc_update.php Diff File