Moodle
  1. Moodle
  2. MDL-36472

My private files user quota error message improvements

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Repositories
    • Labels:
      None
    • Testing Instructions:
      Hide

      Test pre-requisites

      • Change the setting of maxbytes to something relatively smaller
      • Change userquota to something a bit higher than maxbytes

      Test steps

      1. Login as a student
      2. Go to your private files
      3. Make sure there is a valid/correct/accurate error message when:
        • Uploading a larger file than maxbytes
        • Uploading a file which will cause userquota to be exceeded (basically upload one file, and then another one)
        • Drag and drop a larger file than maxbytes
        • Drag and drop multiple files which altogether will exceed userquota
      Show
      Test pre-requisites Change the setting of maxbytes to something relatively smaller Change userquota to something a bit higher than maxbytes Test steps Login as a student Go to your private files Make sure there is a valid/correct/accurate error message when: Uploading a larger file than maxbytes Uploading a file which will cause userquota to be exceeded (basically upload one file, and then another one) Drag and drop a larger file than maxbytes Drag and drop multiple files which altogether will exceed userquota
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36472-master
    • Rank:
      45309

      Description

      Following MDL-33766, Mark identified the following issues:

      1. The error messages do not have full-stops at the end of them like the other pop-up messages in the filemanager.
      2. When I add a file via drag 'n' drop that will exceed the maximum size for new files I am given "Uploaded file NameOfFile4.txt exceeded the maximum size limit set by the form" which is fine, however when I do the same thing via the add link I am given "The uploaded file exceeds the upload_max_filesize directive in php.ini." Why the difference in messages?
      3. When I add a file via drag 'n' drop that is less than the maximum size for new files but will exceed the overall limit I am given "Uploaded file NameOfFile3.txt exceeded the maximum size limit set by the form", this error message is wrong as it gives the impression that the file you are uploading exceeds the maximum size for a single file, when it is actually the overall limit that is being exceeded.
      4. When I add a file via the add link that is less than the maximum size for new files but will exceed the overall limit I am given the message 'Not enough available space to store this file' (notice it is different than when I drag n drop). I find this error message misleading. It may freak out some people who believe their server has no space left and will panic thinking their Moodle is about to crash. Why not something like, 'Adding this file will exceed the overall disk space allowed per upload'?

        Issue Links

          Activity

          Hide
          Frédéric Massart added a comment -

          (Adding Helen and Mark as watcher)
          I am not sure how to be precise enough but not confuse the users at the same time. Here are my comments:

          2/ The reason is that the drag and drop and 'Add' function do not have access to the same information. When you Drag and Drop information about the size of the file is sent through, so we don't need to really proceed to the upload to figure out if the file is too big. The only we're doing is comparing the file against the known 'areamaxbytes' and 'maxbytes'. Both would be limited to the php.ini values. So at that point, the only distinction we can make and relay to the user is whether the area limit has exceeded or the file size.

          What happens Error message
          D&D a file
          • Exceeds the file size limit
          Uploaded file %s exceeded the maximum size limit set by the form
          • Exceeds the area size limit
          Uploaded file %s exceeded the maximum size limit set by the form
          • Exceeds upload limit
          Can't be customised
          • File exceeds setting maxbytes
          Can't be customised
          Upload a file
          • Exceeds the file size limit
          This file is bigger than the maximum size
          • Exceeds the area size limit
          Not enough available space to store this file
          • Exceeds PHP upload limit
          The uploaded file may exceed max_post_size directive in php.ini. or The uploaded file exceeds the upload_max_filesize directive in php.ini., etc...
          • File exceeds setting maxbytes
          Not enough available space to store this file

          The reason why Exceeds the area size limit is identical to File exceeds setting maxbytes is because when the file size limit, or area limit, are greater than the global limit set by the administrator (maxbytes), then they're floored to that value. Therefore the error message displays that they've exceeded the area size, we can't really do much about that, except if we create a new function which returns the reason of the size exceeded... Not sure it is really worth it though.

          Helen, what is your point of view on that?

          Show
          Frédéric Massart added a comment - (Adding Helen and Mark as watcher) I am not sure how to be precise enough but not confuse the users at the same time. Here are my comments: 2/ The reason is that the drag and drop and 'Add' function do not have access to the same information. When you Drag and Drop information about the size of the file is sent through, so we don't need to really proceed to the upload to figure out if the file is too big. The only we're doing is comparing the file against the known 'areamaxbytes' and 'maxbytes'. Both would be limited to the php.ini values. So at that point, the only distinction we can make and relay to the user is whether the area limit has exceeded or the file size. What happens Error message D&D a file Exceeds the file size limit Uploaded file %s exceeded the maximum size limit set by the form Exceeds the area size limit Uploaded file %s exceeded the maximum size limit set by the form Exceeds upload limit Can't be customised File exceeds setting maxbytes Can't be customised Upload a file Exceeds the file size limit This file is bigger than the maximum size Exceeds the area size limit Not enough available space to store this file Exceeds PHP upload limit The uploaded file may exceed max_post_size directive in php.ini. or The uploaded file exceeds the upload_max_filesize directive in php.ini., etc... File exceeds setting maxbytes Not enough available space to store this file The reason why Exceeds the area size limit is identical to File exceeds setting maxbytes is because when the file size limit, or area limit, are greater than the global limit set by the administrator (maxbytes), then they're floored to that value. Therefore the error message displays that they've exceeded the area size, we can't really do much about that, except if we create a new function which returns the reason of the size exceeded... Not sure it is really worth it though. Helen, what is your point of view on that?
          Hide
          Helen Foster added a comment -

          Hi Fred, thanks for adding me as a watcher.

          My suggested solution would be to keep things as simple as possible, with no mention of complicated stuff like php.ini, 'set by the form' etc. and to just convey the message that the file that the user is attempting to add is too big, and ideally to mention which size limit is being exceeded - for individual files or for the total space available in the private files area. If it's the maximum size for individual files, an administrator can check the docs http://docs.moodle.org/24/en/Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F

          I don't think there is any point in providing more meaningful error messages, since nobody apart from an admin can do anything about it. If it's not possible to always determine which size limit is being exceeded, then I suggest we simply inform users that the file is too big and let them figure out whether it's the limit for individual files or the total space available in the private files area which is being exceeded.

          Show
          Helen Foster added a comment - Hi Fred, thanks for adding me as a watcher. My suggested solution would be to keep things as simple as possible, with no mention of complicated stuff like php.ini, 'set by the form' etc. and to just convey the message that the file that the user is attempting to add is too big, and ideally to mention which size limit is being exceeded - for individual files or for the total space available in the private files area. If it's the maximum size for individual files, an administrator can check the docs http://docs.moodle.org/24/en/Administration_FAQ#How_do_the_limits_on_uploaded_files_work.3F I don't think there is any point in providing more meaningful error messages, since nobody apart from an admin can do anything about it. If it's not possible to always determine which size limit is being exceeded, then I suggest we simply inform users that the file is too big and let them figure out whether it's the limit for individual files or the total space available in the private files area which is being exceeded.
          Hide
          Frédéric Massart added a comment -

          Thanks for your feedback Helen. I think we should still display the messages when the PHP upload limit is reached, because it is not related to the size of the area or the file itself. Here is my suggestion:

          D&D

          • In any case: The file %s is too big. It exceeds the maximum size allowed.

          Upload a file

          • Exceeds the file size limit: The file is too big. It exceeds the maximum size allowed.
          • File exceeds maxbytes: The file is too big. It exceeds the maximum size allowed.
          • Exceeds the area size limit: The file is too big. This will exceed the File Manager size limit.
          • PHP upload limits: I'd keep php.ini errors as they are fully implemented.

          I'd like to put your attention on the area limit which, even if only used in Private Files for now, allows a developer to set a global size limit on any area. Thus my use of 'File Manager' which I don't really like... would you have a better idea? (When JavaScript is turned of, it does not look like a File Manager/Picker really)

          Thanks!

          Show
          Frédéric Massart added a comment - Thanks for your feedback Helen. I think we should still display the messages when the PHP upload limit is reached, because it is not related to the size of the area or the file itself. Here is my suggestion: D&D In any case: The file %s is too big. It exceeds the maximum size allowed. Upload a file Exceeds the file size limit: The file is too big. It exceeds the maximum size allowed. File exceeds maxbytes : The file is too big. It exceeds the maximum size allowed. Exceeds the area size limit: The file is too big. This will exceed the File Manager size limit. PHP upload limits: I'd keep php.ini errors as they are fully implemented. I'd like to put your attention on the area limit which, even if only used in Private Files for now, allows a developer to set a global size limit on any area. Thus my use of 'File Manager' which I don't really like... would you have a better idea? (When JavaScript is turned of, it does not look like a File Manager/Picker really) Thanks!
          Hide
          Helen Foster added a comment -

          Hi Fred,

          I suggest the following error message for most cases:

          The file is larger than the maximum size allowed.

          (as simple, short and easy-to-understand as possible, and it seems 'larger' is used more than 'bigger'!)

          For exceeding the area size limit, how about:

          The file is larger than the space remaining in this area.

          Show
          Helen Foster added a comment - Hi Fred, I suggest the following error message for most cases: The file is larger than the maximum size allowed. (as simple, short and easy-to-understand as possible, and it seems 'larger' is used more than 'bigger'!) For exceeding the area size limit, how about: The file is larger than the space remaining in this area.
          Hide
          Frédéric Massart added a comment -

          Thanks Helen, we are getting there! I just realised that those sentences cannot be used when some dragged and dropped files are exceeding the area limit.

          The sentence "The file is larger than the space remaining in this area." would not be appropriate when I'm drag & dropping more than one file. The logic here checks each file for its individual size, if ok the size is added to the pool, at any time if the size of the pool is larger than the area limit the error is triggered and the drag and drop cancelled.

          I thought of "The files altogether are larger than the space remaining in this area.", but that does not sound right when I'm only dropping one file.

          Show
          Frédéric Massart added a comment - Thanks Helen, we are getting there! I just realised that those sentences cannot be used when some dragged and dropped files are exceeding the area limit. The sentence "The file is larger than the space remaining in this area." would not be appropriate when I'm drag & dropping more than one file. The logic here checks each file for its individual size, if ok the size is added to the pool, at any time if the size of the pool is larger than the area limit the error is triggered and the drag and drop cancelled. I thought of "The files altogether are larger than the space remaining in this area.", but that does not sound right when I'm only dropping one file.
          Hide
          Helen Foster added a comment -

          How about:

          The file (or sum of several files) is larger than the space remaining in this area.

          or

          The file (or the total size of several files) is larger than the space remaining in this area.

          Show
          Helen Foster added a comment - How about: The file (or sum of several files) is larger than the space remaining in this area. or The file (or the total size of several files) is larger than the space remaining in this area.
          Hide
          Mark Nelson added a comment -

          Hi Fred, looks good to me. The only issue is the value of the index 'strings' in the array is quite long and could be put onto separate lines.

          Show
          Mark Nelson added a comment - Hi Fred, looks good to me. The only issue is the value of the index 'strings' in the array is quite long and could be put onto separate lines.
          Hide
          Frédéric Massart added a comment -

          Thanks Mark, pushing for integration after fixing the line length.

          Show
          Frédéric Massart added a comment - Thanks Mark, pushing for integration after fixing the line length.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (master only, considering it an improvement), feel free to request a backport with justification, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (master only, considering it an improvement), feel free to request a backport with justification, thanks!
          Hide
          Frédéric Massart added a comment -

          Hi Eloy, I think this should ideally be backported to 2.4 as the new not nice messages were introduced in the related issue and this issue was instantly raised to fix it.

          Show
          Frédéric Massart added a comment - Hi Eloy, I think this should ideally be backported to 2.4 as the new not nice messages were introduced in the related issue and this issue was instantly raised to fix it.
          Show
          Dan Poltawski added a comment - http://docs.moodle.org/dev/Integration_Review#Process_for_requesting_a_non_bug-fix_backport
          Hide
          Adrian Greeve added a comment -

          Tested on the master integration branch.
          All the error messages were correct / accurate.
          No problems found.
          Test passed.

          Show
          Adrian Greeve added a comment - Tested on the master integration branch. All the error messages were correct / accurate. No problems found. Test passed.
          Hide
          Damyon Wiese added a comment -

          Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone!

          Regards, Damyon

          Show
          Damyon Wiese added a comment - Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone! Regards, Damyon

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: