-
Bug
-
Resolution: Fixed
-
Major
-
2.3.4, 2.4.2, 2.5
-
Any
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_23_STABLE, MOODLE_24_STABLE
-
MDL-38268-master -
-
Steps to reproduce::
1) Go to SCORM package settings, and enable "downloaded package type" (scorm | allowtypelocalsync)
2) Verify you have the default value of 56 set for "curltimeoutkbitrate" in Settings.
3) Create a new SCORM module, choosing "Downloaded package" as the Type and entering a remote URL for downloading from
4) Save
Now you can set curltimeoutkbitrate to zero and the SCORM will be created successfully. I'm attaching my screenshot. I believe Heather was receiving a slightly different error, but having a similar outcome.
The problem seems to be in lib/filelib.php around line 1230:
curl_setopt_array ($ch, array(
|
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_NOBODY => false)
|
);
|
The problem here is that simply setting CURLOPT_NOBODY to false is insufficient.
From the PHP documentation:
CURLOPT_NOBODY - TRUE to exclude the body from the output. Request method is then set to HEAD. Changing this to FALSE does not change it to GET.
CURLOPT_HTTPGET - TRUE to reset the HTTP request method to GET. Since GET is the default, this is only necessary if the request method has been changed.
Changing as such allowed the file to successfully download if the curltimeoutkbitrate value was set:
curl_setopt_array ($ch, array(
|
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_NOBODY => false,
|
CURLOPT_HTTPGET => true)
|
);
|
It may be worthwhile to check for this in other areas of Moodle also?
—