mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-84264-main' of https://github.com/pmaneggia/moodle
This commit is contained in:
commit
ff0e03ff56
@ -157,6 +157,7 @@ class backup_course_task extends backup_task {
|
||||
// Link to the course main page (it also covers "&topic=xx" and "&week=xx"
|
||||
// because they don't become transformed (section number) in backup/restore.
|
||||
$content = self::encode_links_helper($content, 'COURSEVIEWBYID', '/course/view.php?id=');
|
||||
$content = self::encode_links_helper($content, 'COURSESECTIONBYID', '/course/section.php?id=');
|
||||
|
||||
// A few other key course links.
|
||||
$content = self::encode_links_helper($content, 'GRADEINDEXBYID', '/grade/index.php?id=');
|
||||
|
@ -160,6 +160,7 @@ class restore_course_task extends restore_task {
|
||||
// Link to the course main page (it also covers "&topic=xx" and "&week=xx"
|
||||
// because they don't become transformed (section number) in backup/restore.
|
||||
$rules[] = new restore_decode_rule('COURSEVIEWBYID', '/course/view.php?id=$1', 'course');
|
||||
$rules[] = new restore_decode_rule('COURSESECTIONBYID', '/course/section.php?id=$1', 'course_section');
|
||||
|
||||
// A few other key course links.
|
||||
$rules[] = new restore_decode_rule('GRADEINDEXBYID', '/grade/index.php?id=$1', 'course');
|
||||
|
@ -52,6 +52,7 @@ final class backup_encode_content_test extends \basic_testcase {
|
||||
$encoded = backup_course_task::encode_content_links(
|
||||
$httproot . '/course/view.php?id=123, ' .
|
||||
$httpsroot . '/course/view.php?id=123, ' .
|
||||
$httpsroot . '/course/section.php?id=123, ' .
|
||||
$httpsroot . '/grade/index.php?id=123, ' .
|
||||
$httpsroot . '/grade/report/index.php?id=123, ' .
|
||||
$httpsroot . '/badges/index.php?type=2&id=123, ' .
|
||||
@ -59,7 +60,8 @@ final class backup_encode_content_test extends \basic_testcase {
|
||||
$httpsroot . '/pluginfile.php/123 and ' .
|
||||
urlencode($httpsroot . '/pluginfile.php/123') . '.'
|
||||
);
|
||||
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@COURSEVIEWBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
|
||||
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@COURSEVIEWBYID*123@$, ' .
|
||||
'$@COURSESECTIONBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
|
||||
'$@GRADEREPORTINDEXBYID*123@$, $@BADGESVIEWBYID*123@$, $@USERINDEXVIEWBYID*123@$, ' .
|
||||
'$@PLUGINFILEBYCONTEXT*123@$ and $@PLUGINFILEBYCONTEXTURLENCODED*123@$.', $encoded);
|
||||
|
||||
@ -68,6 +70,7 @@ final class backup_encode_content_test extends \basic_testcase {
|
||||
$encoded = backup_course_task::encode_content_links(
|
||||
$httproot . '/course/view.php?id=123, ' .
|
||||
$httpsroot . '/course/view.php?id=123, ' .
|
||||
$httproot . '/course/section.php?id=123, ' .
|
||||
$httproot . '/grade/index.php?id=123, ' .
|
||||
$httproot . '/grade/report/index.php?id=123, ' .
|
||||
$httproot . '/badges/index.php?type=2&id=123, ' .
|
||||
@ -75,7 +78,8 @@ final class backup_encode_content_test extends \basic_testcase {
|
||||
$httproot . '/pluginfile.php/123 and ' .
|
||||
urlencode($httproot . '/pluginfile.php/123') . '.'
|
||||
);
|
||||
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@COURSEVIEWBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
|
||||
$this->assertEquals('$@COURSEVIEWBYID*123@$, $@COURSEVIEWBYID*123@$, ' .
|
||||
'$@COURSESECTIONBYID*123@$, $@GRADEINDEXBYID*123@$, ' .
|
||||
'$@GRADEREPORTINDEXBYID*123@$, $@BADGESVIEWBYID*123@$, $@USERINDEXVIEWBYID*123@$, ' .
|
||||
'$@PLUGINFILEBYCONTEXT*123@$ and $@PLUGINFILEBYCONTEXTURLENCODED*123@$.', $encoded);
|
||||
$CFG->wwwroot = $oldroot;
|
||||
|
Loading…
x
Reference in New Issue
Block a user