MDL-73811 reportbuilder: ensure audience cards are uniquely keyed.

This commit is contained in:
Paul Holden
2022-02-08 16:35:59 +00:00
parent 6652ec135b
commit 683fc4d9d1
2 changed files with 3 additions and 0 deletions
@@ -214,9 +214,11 @@ class audience {
$notavailablestr = get_string('notavailable', 'moodle');
$audiencetypes = self::get_audience_types();
$audiencetypeindex = 0;
foreach ($audiencetypes as $categoryname => $audience) {
$menucards = [
'name' => $categoryname,
'key' => 'index' . ++$audiencetypeindex,
];
foreach ($audience as $classname => $name) {
@@ -22,6 +22,7 @@
Example context (json):
{
"name": "General",
"key": "general",
"items": [{
"name": "Manually added users",
"identifier": "core_reportbuilder:users"