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

Warning on install/phpunit init related with upload sizes...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.4
    • Installation, Unit tests
    • None
    • MOODLE_24_STABLE

      Executing the admin/tools/phpunit/cli/init.php script (recently), I'm getting some warnings:

      PHP Warning:  array_merge(): Argument #2 is not an array in /Users/stronk7/git_moodle/moodle/lib/moodlelib.php on line 5994
      PHP Stack trace:
      PHP   1. {main}() /Users/stronk7/git_moodle/moodle/admin/tool/phpunit/cli/util.php:0
      PHP   2. phpunit_util::install_site() /Users/stronk7/git_moodle/moodle/admin/tool/phpunit/cli/util.php:158
      PHP   3. install_cli_database() /Users/stronk7/git_moodle/moodle/lib/phpunit/classes/util.php:857
      PHP   4. admin_apply_default_settings() /Users/stronk7/git_moodle/moodle/lib/installlib.php:484
      PHP   5. admin_get_root() /Users/stronk7/git_moodle/moodle/lib/adminlib.php:6101
      PHP   6. require() /Users/stronk7/git_moodle/moodle/lib/adminlib.php:6079
      PHP   7. get_max_upload_sizes() /Users/stronk7/git_moodle/moodle/admin/settings/courses.php:42
      PHP   8. array_merge() /Users/stronk7/git_moodle/moodle/lib/moodlelib.php:5994

      It seems that at some point the get_max_upload_sizes() function is called with $custombytes = false, and that leads to the warnings.

      Solution should be to fix is_null() condition to also allow false, or, alternatively, inspect and fix where it's being called with that value. Moodle seems to default to 2MB here, but the attempts to apply defaults are failing or something like that. Surely a recent regressions because I was not getting this 2-3 weeks ago.

      PS: Only tried under master, perhaps 23_STABLE and others are getting the same problem.

      PS2: My php setting is "upload_max_filesize = 2M", just in case it's meaningful.

      Ciao

            skodak Petr Skoda
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.