Skip to content

Commit c9d1f4d

Browse files
committed
Alter EventCommentMapper to enable the API to provide the users username on an EventComment. This is already the case with TalkComments and this somewhat standardises the response fields on Event and Talk comments
1 parent 5318f36 commit c9d1f4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/models/EventCommentMapper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ protected function formatOneComment($row, $verbose)
124124
// figure out user
125125
if ($row['user_id']) {
126126
$result['user_display_name'] = $row['full_name'];
127+
$result['username'] = $row['username'];
127128
$result['user_uri'] = $base . '/' . $version . '/users/'
128129
. $row['user_id'];
129130
} else {
@@ -147,7 +148,7 @@ protected function formatOneComment($row, $verbose)
147148

148149
protected function getBasicSQL($include_hidden = false)
149150
{
150-
$sql = 'select ec.*, user.email, user.full_name, e.event_tz_cont, e.event_tz_place '
151+
$sql = 'select ec.*, user.username, user.email, user.full_name, e.event_tz_cont, e.event_tz_place '
151152
. 'from event_comments ec '
152153
. 'left join user on user.ID = ec.user_id '
153154
. 'inner join events e on ec.event_id = e.ID '

0 commit comments

Comments
 (0)