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

In correct error message while uploading files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.8
    • Fix Version/s: None
    • Component/s: Filepicker
    • Labels:
    • Affected Branches:
      MOODLE_28_STABLE

      Description

      When someone uploads a file which is greater than the max upload limit set in php.ini, the user is shown a message saying "A required parameter(sesskey) was missing" instead of the actual factor.

      I noticed this error, while trying to restore a backup.

      The code responsible for the correct message is (repository_ajax.php)

      // If uploaded file is larger than post_max_size (php.ini) setting, $_POST content will be empty.
      if (empty($_POST) && !empty($action)) {
          $err->error = get_string('errorpostmaxsize', 'repository');
          die(json_encode($err));
      }
      

      Seems it is expecting $_GET['action'] to be set, which is not in this case.

      I have not tested in other places to be sure if the problem is localized to the restore page or not.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ankit_frenz Ankit Agarwal
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: