MDL-80190 core_courseformat: prevent delegated sections loops
This patch prevent dropping an activity with delegated sections inside another delegated section. Without this patch the teacher can create a deadlock drag&droping the subsection inside itself. We won't allow subsections inside subsections so any activity with subsection cannot be dropped inside a subsección.
This commit is contained in:
@@ -72,4 +72,10 @@ class sectiondelegate_test extends \advanced_testcase {
|
||||
$this->assertInstanceOf('\test_component\courseformat\sectiondelegate', sectiondelegate::instance($sectioninfos[2]));
|
||||
$this->assertNull(sectiondelegate::instance($sectioninfos[3]));
|
||||
}
|
||||
|
||||
public function test_has_delegate_class(): void {
|
||||
$this->assertFalse(sectiondelegate::has_delegate_class('missing_component'));
|
||||
$this->assertFalse(sectiondelegate::has_delegate_class('mod_label'));
|
||||
$this->assertTrue(sectiondelegate::has_delegate_class('test_component'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user