MDL-83469 core_courseformat: alternative new_module actions
The previous create_module actions uses section number instead of section id. This produces several bugs when sections are moved around the course in edit mode. This issue implements a new_module action with all related mutations and webservices. The new one uses section id instead of section number.
This commit is contained in:
@@ -69,6 +69,7 @@ final class create_module_test extends \externallib_advanced_testcase {
|
||||
|
||||
// Execute course action.
|
||||
$results = json_decode(create_module::execute((int)$course->id, $modname, (int)$targetsection->id, (int)$activity->id));
|
||||
$this->assertDebuggingCalled();
|
||||
|
||||
// Check result.
|
||||
$cmupdate = $this->find_update_by_fieldname($results, 'put', 'cm', get_string('quickcreatename', 'mod_' . $modname));
|
||||
@@ -122,6 +123,7 @@ final class create_module_test extends \externallib_advanced_testcase {
|
||||
// Execute course action.
|
||||
$modname = 'book';
|
||||
create_module::execute((int)$course->id, $modname, (int)$targetsection->id);
|
||||
$this->assertDebuggingCalled();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user