From ca6731dff76253c1c366aaeea7ed68c79c91b37d Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 20 Jul 2023 15:37:01 +0100 Subject: [PATCH] MDL-78117 comment: use new context entity in system report. --- .../reportbuilder/local/systemreports/comments.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/comment/classes/reportbuilder/local/systemreports/comments.php b/comment/classes/reportbuilder/local/systemreports/comments.php index 0e94123212e..da41670e6f8 100644 --- a/comment/classes/reportbuilder/local/systemreports/comments.php +++ b/comment/classes/reportbuilder/local/systemreports/comments.php @@ -23,6 +23,7 @@ use lang_string; use moodle_url; use pix_icon; use stdClass; +use core\reportbuilder\local\entities\context; use core_reportbuilder\system_report; use core_reportbuilder\local\entities\user; use core_reportbuilder\local\report\action; @@ -53,6 +54,13 @@ class comments extends system_report { return [$row->id, get_string('select')]; }); + // Join the context entity. + $contextentity = (new context()) + ->set_table_alias('context', $commententity->get_table_alias('context')); + $this->add_entity($contextentity + ->add_join($commententity->get_context_join()) + ); + // Join the user entity to the comment userid (author). $userentity = new user(); $useralias = $userentity->get_table_alias('user'); @@ -82,7 +90,7 @@ class comments extends system_report { $this->add_columns_from_entities([ 'user:fullnamewithlink', 'comment:content', - 'comment:contexturl', + 'context:link', 'comment:timecreated', ]);