# 群用户名搜索空搜索消息不正确

**URL:** https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609
**Category:** UX
**Created:** [2021年七月29日 20:27 UTC](https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609 "2021-07-29T20:27:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2021年七月29日 20:27 UTC](https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609/1 "2021-07-29T20:27:20Z")

</div>

当使用组的搜索框按用户名或电子邮件地址搜索用户时，如果没有匹配项，将返回消息“该组中没有成员”：

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/b/cb5ae79a9fdf67fff4492b3f00afd58563d32cd3.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/5/75ff4df932e6e366ff1a77d2bd438299a50d8202.png)

该组中有 50 名成员，只是没有用户名为“jim”的成员。

一个简单的修复方法是直接硬编码一条更合适的错误消息。例如，“没有成员匹配您的搜索词”。这样的修复是否足够？

编辑：我现在明白问题了。消息“该组中没有成员”并不是对搜索的响应，而是当没有返回成员时在组的成员页面上显示的内容。这发生在这里：[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/templates/group-index.hbs#L117。要修复它，仅修改文本是不够的。](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/templates/group-index.hbs#L117%E3%80%82%E8%A6%81%E4%BF%AE%E5%A4%8D%E5%AE%83%EF%BC%8C%E4%BB%85%E4%BF%AE%E6%94%B9%E6%96%87%E6%9C%AC%E6%98%AF%E4%B8%8D%E5%A4%9F%E7%9A%84%E3%80%82)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2021年七月30日 10:19 UTC](https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609/2 "2021-07-30T10:19:56Z")

</div>

这应该能解决问题：

> <https://github.com/discourse/discourse/pull/13899>
>
> Previously it would say "There are no members in this group". Now it says "No me…mbers match that search."
> 
> https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609

 ![Screenshot 2021-07-30 at 11.19.40](https://global.discourse-cdn.com/meta/original/3X/3/0/3015f0dbc1bab5c746ce8436e430e936ef00c3aa.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2021年八月2日 07:00 UTC](https://meta.discourse.org/t/group-username-search-empty-search-message-is-wrong/198609/3 "2021-08-02T07:00:33Z")

</div>

此主题已在 2 天后自动关闭。不再允许新的回复。
