mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
Merge branch 'wip-MDL-39233-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
e698e24f1a
@ -582,6 +582,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
|
||||
$label = $this->getDataGenerator()->create_module('label', array('course' => $course->id,
|
||||
'intro' => $labeldescription));
|
||||
$labelcm = get_coursemodule_from_instance('label', $label->id);
|
||||
$url = $this->getDataGenerator()->create_module('url', array('course' => $course->id));
|
||||
|
||||
// Set the required capabilities by the external function.
|
||||
$context = context_course::instance($course->id);
|
||||
@ -614,8 +615,8 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
|
||||
}
|
||||
$this->assertEquals(2, $testexecuted);
|
||||
|
||||
// Check that the only return section has the 4 created modules
|
||||
$this->assertEquals(4, count($firstsection['modules']));
|
||||
// Check that the only return section has the 5 created modules
|
||||
$this->assertEquals(5, count($firstsection['modules']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -265,9 +265,9 @@ function url_export_contents($cm, $baseurl) {
|
||||
$context = context_module::instance($cm->id);
|
||||
|
||||
$course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
|
||||
$url = $DB->get_record('url', array('id'=>$cm->instance), '*', MUST_EXIST);
|
||||
$urlrecord = $DB->get_record('url', array('id'=>$cm->instance), '*', MUST_EXIST);
|
||||
|
||||
$fullurl = str_replace('&', '&', url_get_full_url($url, $cm, $course));
|
||||
$fullurl = str_replace('&', '&', url_get_full_url($urlrecord, $cm, $course));
|
||||
$isurl = clean_param($fullurl, PARAM_URL);
|
||||
if (empty($isurl)) {
|
||||
return null;
|
||||
@ -275,12 +275,12 @@ function url_export_contents($cm, $baseurl) {
|
||||
|
||||
$url = array();
|
||||
$url['type'] = 'url';
|
||||
$url['filename'] = $url->name;
|
||||
$url['filename'] = $urlrecord->name;
|
||||
$url['filepath'] = null;
|
||||
$url['filesize'] = 0;
|
||||
$url['fileurl'] = $fullurl;
|
||||
$url['timecreated'] = null;
|
||||
$url['timemodified'] = $url->timemodified;
|
||||
$url['timemodified'] = $urlrecord->timemodified;
|
||||
$url['sortorder'] = null;
|
||||
$url['userid'] = null;
|
||||
$url['author'] = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user