EBMS Tickets

Issue Number 486
Summary [Full Citation] More informative error messages on Full Citation page
Created 2018-10-19 11:37:12
Issue Type Improvement
Submitted By Juthe, Robin (NIH/NCI) [E]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2019-10-03 10:16:34
Resolution Fixed
Path /home/bkline/backups/jira/oceebms/issue.234629
Description

We should review the error messages we receive on the Full Citation page and consider whether they can be made more informative/helpful.

For example, we recently ran into an issue whereby we were unable to upload a large PDF (22MB) because it exceeded the threshold of 20MB. I posted a screenshot of the error message below, indicating that it was not a PDF. Ideally, the system would tell us that the file size was too large instead.

Comment entered 2018-10-19 12:23:21 by Kline, Bob (NIH/NCI) [C]
diff --git a/ebms.nci.nih.gov/modules/custom/ebms/citations.inc b/ebms.nci.nih.gov/modules/custom/ebms/citations.inc
index 3473862..91bb736 100644
--- a/ebms.nci.nih.gov/modules/custom/ebms/citations.inc
+++ b/ebms.nci.nih.gov/modules/custom/ebms/citations.inc
@@ -2631,7 +2631,8 @@ namespace {
                 $mime_type = Ebms\Util::get_mime_type($path);
                 if ($mime_type != 'application/pdf') {
                     drupal_set_message(htmlspecialchars($value) .
-                        ' is not a PDF file.', 'error');
+                        ' is not a PDF file or exceeds the limit of 20MB.',
+                        'error');
                     continue;
                 }
                 $file = file_save_upload($key, $validators);

(BTW, CBIIT tells me they're going to apply a fix for the JIRA bug which causes the bogus error message at the top of this comments. More than a year after the fix became available.)

Comment entered 2019-08-09 11:52:41 by Kline, Bob (NIH/NCI) [C]

Implemented on DEV.

Comment entered 2019-09-25 15:58:37 by Juthe, Robin (NIH/NCI) [E]

Nothing is happening when we try to upload a file that exceeds the file limit. No error message appears. I'm thinking this may have been broken by the subsequent change to the mechanism/location for uploading full text articles? (OCEEBMS-524)

Comment entered 2019-09-27 17:24:36 by Kline, Bob (NIH/NCI) [C]

I've done some digging into this, and it appears that the software is able to display the desired error message if the file size exceeds the upload_max_filesize limit of 20MB, as long as it does not also exceed the post_max_size of 32MB. I've asked my colleagues if there is some way to work around this problem, but the research I've done so far doesn't leave me optimistic. It is at least a good thing that the software is able to assist those users who may be uncertain about a borderline file as to whether it will exceed the lower threshold. I suppose we could proactively put a warning on the form to say "You can only upload a PDF file of 20MB or smaller. If you try to upload a file which is larger than 32MB you won't even get an error message." But that's probably the best we can do.

Comment entered 2019-10-01 16:20:13 by Juthe, Robin (NIH/NCI) [E]

This is OK. I don't think files >32MB are very common. Could we modify the text on the form to remind us of the size limit? Here's what I suggest:

"Select a PDF file smaller than 20 MB to be uploaded."

Comment entered 2019-10-03 10:16:34 by Kline, Bob (NIH/NCI) [C]

Modification added (QA and DEV).

Comment entered 2019-10-03 11:16:18 by Juthe, Robin (NIH/NCI) [E]

I'm not seeing this on DEV or QA. I'll post a screenshot from QA.

Comment entered 2019-10-03 11:27:05 by Kline, Bob (NIH/NCI) [C]

Sorry, please try again.

Comment entered 2019-10-03 11:31:14 by Juthe, Robin (NIH/NCI) [E]

No problem. That looks good. Thank you!

Comment entered 2019-10-03 11:31:23 by Juthe, Robin (NIH/NCI) [E]

Verified on QA.

Attachments
File Name Posted User
EBMS PDF error message.png 2018-10-19 11:37:21 Juthe, Robin (NIH/NCI) [E]
upload PDF.png 2019-10-03 11:16:46 Juthe, Robin (NIH/NCI) [E]

Elapsed: 0:00:00.000733