diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-04 08:53:21 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-04 08:53:21 +0000 |
commit | 16db51ec588bad1f341ffd3be9153cc453fce0f1 (patch) | |
tree | 07c792fce4ca269bfc0d35d8faf2bff404381b7e /app | |
parent | e9e79fdfdf7eee14efa9c5e8038b46538b6ac5e3 (diff) | |
parent | d79348ab55c668883aa8d2a7fd5b59f28eb5118a (diff) | |
download | gitlab-ce-16db51ec588bad1f341ffd3be9153cc453fce0f1.tar.gz |
Merge branch 'fix-wiki-search' into 'master'
Fix Error 500 when searching Wiki pages
If a Wiki page turns up a hit in the search results, an error will occur:
```
Completed 500 Internal Server Error in 836ms
NoMethodError - undefined method `slug' for "test.markdown":String:
app/helpers/wiki_helper.rb:10:in `namespace_project_wiki_path'
app/views/search/results/_wiki_blob.html.haml:4:in `_app_views_search_results__wiki_blob_html_haml___2752621660395393333_70299911622700'
actionview (4.1.9) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.9) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.9) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.9) lib/action_view/template.rb:143:in `render'
```
An unhandled String containing the name of the Wiki page would be provided to the URL path generator. This MR handles that case.
Closes #1547
See merge request !592
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/wiki_helper.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index a3bc64c010e..f8a96516e61 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -6,6 +6,8 @@ module WikiHelper case wiki_page when Symbol wiki_page + when String + wiki_page else wiki_page.slug end |