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

installation and phpunit init regression caused by MDL-30667

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      1/ make fresh install - no warnings or notices expected
      2/ init phpunit environment - no warnings or notices expected
      3/ manually inject custom value into plugin config table via set_config('maxbytes', 666, 'moodlecourse');
      4/ verify the custom value is displayed in admin setting for maxbytes

      Show
      1/ make fresh install - no warnings or notices expected 2/ init phpunit environment - no warnings or notices expected 3/ manually inject custom value into plugin config table via set_config('maxbytes', 666, 'moodlecourse'); 4/ verify the custom value is displayed in admin setting for maxbytes
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w38_MDL-35454_m24_bogusmaxsize

      Description

          $currentmaxbytes = get_config('moodlecourse', 'maxbytes');
          if (isset($CFG->maxbytes)) {
              $choices = get_max_upload_sizes($CFG->maxbytes, 0, 0, $currentmaxbytes);
          } else {
              $choices = get_max_upload_sizes(0, 0, 0, $currentmaxbytes);
          }

      missing value from get_config() is FALSE.

          // If custombytes is given then add it to the list.
          if (!is_null($custombytes)) {
              if (is_number($custombytes)) {
                  $custombytes = array((int)$custombytes);
              }
              $sizelist = array_unique(array_merge($sizelist, $custombytes));
          }

      can not deal with non-array data such as false, this needs to be reworked.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            skodak Petr Skoda added a comment -

            Sending for peer-review, I suppose this should be fixed asap.

            Show
            skodak Petr Skoda added a comment - Sending for peer-review, I suppose this should be fixed asap.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Looks spot on thanks Petr, I hit this issue this morning and tested your fix. Works perfectly.

            Show
            samhemelryk Sam Hemelryk added a comment - Looks spot on thanks Petr, I hit this issue this morning and tested your fix. Works perfectly.
            Hide
            poltawski Dan Poltawski added a comment -

            Integrated, thanks

            Show
            poltawski Dan Poltawski added a comment - Integrated, thanks
            Hide
            abgreeve Adrian Greeve added a comment -

            Tested on 2.2, 2.3 and Master integration branches.
            No warnings or notices were seen.
            Custom value for maxbytes was verified.
            Test passed.

            Show
            abgreeve Adrian Greeve added a comment - Tested on 2.2, 2.3 and Master integration branches. No warnings or notices were seen. Custom value for maxbytes was verified. Test passed.
            Hide
            poltawski Dan Poltawski added a comment -

            Congratulations, you've done it!

            Thanks, this change is now in the latest weekly release!

            Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

            Show
            poltawski Dan Poltawski added a comment - Congratulations, you've done it! Thanks, this change is now in the latest weekly release! Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Nov/12