Wiki search breaks with hierarchical paths
The search results page incorrectly uses the basename of wiki results instead of simply dropping the extension.
Steps to reproduce
- Create a wiki page with a directory component (e.g.
- Use the search interface to find the page
- Click on the result; you will be taken to a 404 as the target of the link is
- Example page: https://gitlab.com/bgamari/wiki-search-bug/wikis/test/hello
- Example query: https://gitlab.com/search?utf8=%E2%9C%93&search=hello&group_id=&project_id=11452833&scope=wiki_blobs&repository_ref=
What is the current bug behavior?
Search results point to nonexistent wiki pages.
What is the expected correct behavior?
Search results point to the existent pages.
Output of checks
This bug happens on GitLab.com
The problem appears to be that
app/views/search/results/_wiki_blob.html.haml uses the blob's
basename as the link target. This was likely intended to merely remove the file extension however has the effect of also removing the path's directory component.