MDL-61637 tool_dataprivacy: Point to new blocks API function
authorDavid Monllao <davidm@moodle.com>
Thu, 10 May 2018 13:55:39 +0000 (15:55 +0200)
committerDavid Monllao <davidm@moodle.com>
Fri, 11 May 2018 07:05:43 +0000 (09:05 +0200)
admin/tool/dataprivacy/classes/output/data_registry_page.php

index 5263f8e..62f51fb 100644 (file)
@@ -319,14 +319,8 @@ class data_registry_page implements renderable, templatable {
                 continue;
             }
 
-            if (function_exists('block_instance_by_id')) {
-                $blockinstance = block_instance_by_id($childcontext->instanceid);
-            } else {
-                // TODO To be removed when MDL-61621 gets integrated.
-                $blockinstance = $DB->get_record('block_instances', ['id' => $childcontext->instanceid]);
-                $blockinstance = block_instance($blockinstance->blockname, $blockinstance);
-            }
-            $displayname = shorten_text(format_string($blockinstance->get_title(), true, ['context' => $childcontext->id]));
+            $blockinstance = block_instance_by_id($childcontext->instanceid);
+            $displayname = shorten_text(format_string($blockinstance->get_title(), true, ['context' => $childcontext]));
             $branches[] = self::complete([
                 'text' => $displayname,
                 'contextid' => $childcontext->id,