diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-25 11:22:19 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-25 11:22:19 +0300 |
commit | 0030fe53818b7c3a56ce81fb05175879d0e47533 (patch) | |
tree | b7db01d7e3cb891d1626fd2ecb9ec199f2bb1cf0 /app/models | |
parent | 1b6de302bdf4af12cd54d85b8178df0d557641a9 (diff) | |
parent | 42a00f740b04555d9150f900145b4dd685000aaf (diff) |
Merge branch 'fix-wiki-error-500' into 'master'
Fix Error 500 when creating Wiki pages with hyphens or spaces
- Closes gitlab-com/support-forum#874
- Closes #20209
See merge request !5444
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/wiki_page.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 3d5fd9d3ee9..c3de278f5b7 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -44,7 +44,11 @@ class WikiPage # The escaped URL path of this page. def slug - @attributes[:slug] + if @attributes[:slug].present? + @attributes[:slug] + else + wiki.wiki.preview_page(title, '', format).url_path + end end alias_method :to_param, :slug |