Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.3.5, 3.4.2
-
Component/s: Privacy, Unit tests
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_33_STABLE, MOODLE_34_STABLE
-
Fixed Branches:MOODLE_33_STABLE, MOODLE_34_STABLE
-
Epic Link:
-
Pull from Repository:
-
Pull Master Branch:
MDL-61974-master -
Pull Master Diff URL:
Description
Here is a test.
/**
|
* Test export and recover with children.
|
*/
|
public function test_get_data_with_children() {
|
$writer = $this->get_writer_instance();
|
$context = \context_system::instance();
|
|
$writer->set_context($context)
|
->export_data(['a'], (object) ['parent' => true])
|
->export_data(['a', 'b'], (object) ['parent' => false]);
|
|
$this->assertTrue($writer->get_data(['a'])->parent);
|
$this->assertFalse($writer->get_data(['a', 'b'])->parent);
|
$this->assertSame([], $writer->get_data(['a', 'b', 'c']));
|
}
|
I identified two issues:
- Writing a sub context overrides the parent
- Getting a sub context that does not exist returns the parent
Andrew mentioned that this will likely affect other `get_*` methods.
Attachments
Issue Links
- blocks
-
MDL-61836 Implement core_privacy for core_blog
-
- Closed
-