Skip to content

Commit

Permalink
Merge pull request #2848 from ExpressionEngine/bug/7.x/author-filter-…
Browse files Browse the repository at this point in the history
…missing-label

Resolved an issue where the author filter could have a missing label.
  • Loading branch information
intoeetive committed Feb 15, 2023
2 parents e54d4ee + b264625 commit 046b6d4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ protected function setupEntries()
private function createAuthorFilter($channel_id = null)
{
$db = ee('db')->distinct()
->select('t.author_id, m.screen_name')
->select('t.author_id, m.screen_name, m.username')
->from('channel_titles t')
->join('members m', 'm.member_id = t.author_id', 'LEFT')
->order_by('screen_name', 'asc');
Expand All @@ -385,7 +385,7 @@ private function createAuthorFilter($channel_id = null)

$author_filter_options = [];
foreach ($authors_query->result() as $row) {
$author_filter_options[$row->author_id] = $row->screen_name;
$author_filter_options[$row->author_id] = (!empty($row->screen_name)) ? $row->screen_name : $row->username;
}

// Put the current user at the top of the author list
Expand Down

0 comments on commit 046b6d4

Please sign in to comment.