Skip to content
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

Fix #6244: html: Search function is broken with 3rd party themes #6257

Merged
merged 1 commit into from Apr 6, 2019

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Apr 6, 2019

Feature or Bugfix

  • Bugfix

Purpose

@tk0miya tk0miya added this to the 2.0.1 milestone Apr 6, 2019
@codecov
Copy link

codecov bot commented Apr 6, 2019

Codecov Report

Merging #6257 into 2.0.1 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            2.0.1    #6257   +/-   ##
=======================================
  Coverage   83.55%   83.55%           
=======================================
  Files         274      274           
  Lines       39403    39403           
  Branches     5871     5871           
=======================================
  Hits        32924    32924           
  Misses       5127     5127           
  Partials     1352     1352

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e239291...a6e3170. Read the comment docs.

@tk0miya tk0miya merged commit 8742761 into sphinx-doc:2.0.1 Apr 6, 2019
@tk0miya tk0miya deleted the 6244_broken_search branch April 6, 2019 04:50
@bnmnetp
Copy link

bnmnetp commented Aug 12, 2019

Search is still broken for me in 2.1.2. I do have a custom theme and have been trying to figure out what is happening.

Javascript throws an error on line 66 of searchtools.js because docContent is undefined.

The loadIndex function is not called for me anywhere. Nor do I find any element in the generated source that would match '[role=main]'

Any hints on how to fix my templates or where to look from here would be much appreciated!

Thanks,

@vsalvino
Copy link
Contributor

I am also getting the same error with docContent undefined. Tried using various stock themes instead of my custom theme, same issue persists throughout.

One item of note, it seems to be "more broken" when building with dirhtml mode versus html mode. The error occurs in both but it seems to only occur about half of the time in html mode. This leads me to believe there is some kind of race condition at play, such as a file or request not being finished before the search script starts working.

@vsalvino
Copy link
Contributor

Update: I figured out the issue, it appears to be a bug in searchtools.js that was incorrectly querying the URLs. And another semi-related bug which might related to 3rd party themes (the docContent is undefined) if your HTML output does not contain a role="main" element. See PR #7192 .

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants