Commit 668a5b9f authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix projects without repo and wiki

When repo and wiki are disabled for a project,
we're showing issues so we'll need to set @issuable_meta_data
otherwise it would be giving nil errors. See:

https://sentry.gitlap.com/gitlab/staginggitlabcom/issues/23106/
parent 253b61d2
...@@ -267,8 +267,9 @@ class ProjectsController < Projects::ApplicationController ...@@ -267,8 +267,9 @@ class ProjectsController < Projects::ApplicationController
@project_wiki = @project.wiki @project_wiki = @project.wiki
@wiki_home = @project_wiki.find_page('home', params[:version_id]) @wiki_home = @project_wiki.find_page('home', params[:version_id])
elsif @project.feature_available?(:issues, current_user) elsif @project.feature_available?(:issues, current_user)
@issues = issues_collection @issues = issues_collection.page(params[:page])
@issues = @issues.page(params[:page]) @collection_type = 'Issue'
@issuable_meta_data = issuable_meta_data(@issues, @collection_type)
end end
render :show render :show
......
...@@ -78,6 +78,7 @@ describe ProjectsController do ...@@ -78,6 +78,7 @@ describe ProjectsController do
it 'shows issues list page if wiki is disabled' do it 'shows issues list page if wiki is disabled' do
project.project_feature.update_attribute(:wiki_access_level, ProjectFeature::DISABLED) project.project_feature.update_attribute(:wiki_access_level, ProjectFeature::DISABLED)
create(:issue, project: project)
get :show, namespace_id: project.namespace, id: project get :show, namespace_id: project.namespace, id: project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment