Closed Bug 1063560 Opened 5 years ago Closed 2 years ago

Search output with locale=* says at the top that the results found were in English, but includes all locales

Categories

(developer.mozilla.org :: Search, defect, minor)

All
Other
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sheppy, Assigned: bhattacharyya.rick14, Mentored)

References

Details

(Whiteboard: [specification][type:bug])

What did you do?
================
1. Ran this search: https://developer.mozilla.org/en-US/search?locale=*&kumascript_macros=LandingPageListSubpages

What happened?
==============
The result page says:

RESULTS
240 documents found in English.

But most of the listed pages are not in fact in English.

What should have happened?
==========================
This text should instead say "240 documents found in all locales."

And, ideally, would offer a filter option to narrow it down to a specific locale.

Is there anything else we should know?
======================================
The issue is one of labeling: When the search parameters include "locale=*" we should not include anything about the locale in the label above the search.
Severity: normal → minor
Duplicate of this bug: 1213854
Component: General → Search
Seen again in mozilla/kuma#4179
Assignee: nobody → jwhitlock
On second thought, this is a good bug for me to mentor.  I'd call it medium difficulty.  A new contributor would need to:

1. Install Kuma locally, with the sample database [1]
2. Populate the search index [2]
3. Reproduce the issue, such a by loading an all-documents macro search [3], see 'documents found in English (US)'
4. Fix it!

[1] https://kuma.readthedocs.io/en/latest/installation.html
[2] https://kuma.readthedocs.io/en/latest/elasticsearch.html#indexing-document
[3] http://localhost:8000/en-US/search?topic=none&kumascript_macros=CompatNo&locale=*
Assignee: jwhitlock → nobody
Mentor: jwhitlock
I want to fix this bug, please assign me this.
Thank you for wanting to work on this! I've assigned it to you.
For any questions please refer to John.

Sebastian
Assignee: nobody → rounakraj8
Status: NEW → ASSIGNED
Is work still in progress for this bug? If not, I would like to take it up. Thank you.
Deep - I'm reassigning to you. You'll need to follow the steps in comment 4.
Assignee: rounakraj8 → bhattacharyya.rick14
I have installed Kuma locally along with the sample database, populated the search index and reproduced the issue. I am assuming that the relevant code for this bug is present in kuma/search. Please correct me if I'm wrong. Thank you.
1. I guess I need to place a check to see if the language filter has been overridden in kuma/search/jinja2/results.html template. Please let me know if there is anything else that I should take care of.

2. Also, since there is already a test for language_filter_override in test_filters.py, I'm assuming I do not need to write any separate test for this bug fix. Please correct me if I'm wrong.

Thank you.
Deep, it sounds like you are on the right track. I'm not aware of any existing template tests that would need to be updated for this change, and the tests are in need of a serious refactor, so anything beyond fixing tests broken by the change would probably be out of scope. I think we can rely on manual testing for this change. I look forward to your PR!
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/17170848312939b6b80658d1feb18dbcd07ac7a4
Fix bug 1063560: Change search output with locale=*

- Display "found in all locales" instead of "found in English(US)"

https://github.com/mozilla/kuma/commit/c714a1560ef4e98e8d971a9d0d8f7f20ffb0f243
Merge pull request #4580 from coderick14/patch-for-bug-1063560

Fix bug 1063560: Change search output with locale=*
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.