mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 15:49:43 +02:00
MDL-43700 reports: Update to the sql in the comment locallib to include additional name fields.
This commit is contained in:
parent
12efa52762
commit
5e9c9e0e39
1 changed files with 5 additions and 3 deletions
|
@ -61,7 +61,8 @@ class comment_manager {
|
|||
}
|
||||
$comments = array();
|
||||
|
||||
$sql = "SELECT c.id, c.contextid, c.itemid, c.commentarea, c.userid, c.content, u.firstname, u.lastname, c.timecreated
|
||||
$usernamefields = get_all_user_name_fields(true, 'u');
|
||||
$sql = "SELECT c.id, c.contextid, c.itemid, c.commentarea, c.userid, c.content, $usernamefields, c.timecreated
|
||||
FROM {comments} c
|
||||
JOIN {user} u
|
||||
ON u.id=c.userid
|
||||
|
@ -74,8 +75,9 @@ class comment_manager {
|
|||
$item->time = userdate($item->timecreated);
|
||||
$item->content = format_text($item->content, FORMAT_MOODLE, $formatoptions);
|
||||
// Unset fields not related to the comment
|
||||
unset($item->firstname);
|
||||
unset($item->lastname);
|
||||
foreach (get_all_user_name_fields() as $namefield) {
|
||||
unset($item->$namefield);
|
||||
}
|
||||
unset($item->timecreated);
|
||||
// Record the comment
|
||||
$comments[] = $item;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue