Skip to content

Search result titles incorrectly include "(from project foo)" #3792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
begriffs opened this issue Mar 13, 2018 · 6 comments
Closed

Search result titles incorrectly include "(from project foo)" #3792

begriffs opened this issue Mar 13, 2018 · 6 comments
Labels
Bug A bug

Comments

@begriffs
Copy link

Expected Result

Search results should list the title of each page and a snippet.

Title One
some stuff in the page

Title Two
other stuff

Actual Result

Each title ends with a note "(from project foo)"

Title One (from project foo)
some stuff in the page

Title Two (from project foo)
other stuff

example

Cause

A recent commit to fix linter errors changed a != operator to !==: https://github.com/rtfd/readthedocs.org/blame/e923c0cdf7547e63b4d2a9ab2b5e69b527bb482b/readthedocs/core/static-src/core/js/doc-embed/search.js#L52-L57

if (fields.project !== project) {

Adding a breakpoint to that code, I saw that fields.project had the value ['foo'] while project was 'foo'. The old comparison treated them as equal, but the strict comparison knows that they differ.

/cc @bansalnitish

@stsewd
Copy link
Member

stsewd commented Mar 13, 2018

@humitos
Copy link
Member

humitos commented Mar 14, 2018

@davidfischer seems that the linting PR around js code, breaks the search page results. It makes sense to me what @begriffs is saying here. Can you take a look at this?

@humitos humitos added the Bug A bug label Mar 14, 2018
@bansalnitish
Copy link
Contributor

We can revert this case as well as mark the check as a warning instead of error for fixing this issue.

@humitos
Copy link
Member

humitos commented Mar 20, 2018

Why fields.project is ['foo'] instead of just 'foo' in first instance? Maybe that it's what needs to be changed, right?

@begriffs
Copy link
Author

Any decision about what to do, i.e. revert the breaking change, or store as 'foo' rather than ['foo']? The former sounds more straightforward even though it seems like somewhat unclean code.

@stsewd
Copy link
Member

stsewd commented May 31, 2018

Resolved on #4176

@stsewd stsewd closed this as completed May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

4 participants