Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69718

The display_size function doesn't support terabytes and petabytes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.10, 4.0
    • Fix Version/s: 3.10
    • Component/s: Libraries
    • Testing Instructions:
      Hide

      Just unit tests

      Or if you want to see if in the gui a quick hack is add a couple zeros here:

      --- a/lib/portfoliolib.php
      +++ b/lib/portfoliolib.php
      @@ -1007,7 +1007,7 @@ function portfolio_expected_time_file($totest) {
        */
       function portfolio_filesize_info() {
           $filesizes = array();
      -    $sizelist = array(10240, 51200, 102400, 512000, 1048576, 2097152, 5242880, 10485760, 20971520, 52428800);
      +    $sizelist = array(10240, 51200, 102400, 512000, 1048576, 2097152, 5242880, 10485760, 20971520, 5242880000);
           foreach ($sizelist as $size) {
               $filesizes[$size] = display_size($size);
           }
      l

      And then see it in the admin gui here:

      http://moodle.local/admin/settings.php?section=manageportfolioscommon

      Show
      Just unit tests Or if you want to see if in the gui a quick hack is add a couple zeros here: --- a/lib/portfoliolib.php +++ b/lib/portfoliolib.php @@ -1007,7 +1007,7 @@ function portfolio_expected_time_file($totest) { */ function portfolio_filesize_info() { $filesizes = array(); - $sizelist = array(10240, 51200, 102400, 512000, 1048576, 2097152, 5242880, 10485760, 20971520, 52428800); + $sizelist = array(10240, 51200, 102400, 512000, 1048576, 2097152, 5242880, 10485760, 20971520, 5242880000); foreach ($sizelist as $size) { $filesizes[$size] = display_size($size); } l And then see it in the admin gui here: http://moodle.local/admin/settings.php?section=manageportfolioscommon
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE
    • Pull 3.10 Branch:
      MDL-69718-display-size-MOODLE_310_STABLE
    • Pull Master Branch:
      MDL-69718-display-size

      Description

      It only goes as big as gigabytes

        Attachments

          Activity

            People

            Assignee:
            brendanheywood Brendan Heywood
            Reporter:
            brendanheywood Brendan Heywood
            Peer reviewer:
            Mikhail Golenkov
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Nov/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m