Project

General

Profile

Defect #35789 » 0002-Don-t-throw-a-404-error-on-activities-index-with-a-n.patch

Patch against trunk @ 21194. - Mischa The Evil, 2021-08-20 19:07

View differences:

app/controllers/activities_controller.rb
@date_from = @date_to - @days
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
if params[:user_id].present?
@author = User.visible.active.find(params[:user_id])
begin
visible_and_active_user = User.visible.active.find(params[:user_id])
rescue ActiveRecord::RecordNotFound
@author = nil
else
@author = visible_and_active_user
end
end
@activity = Redmine::Activity::Fetcher.new(User.current, :project => @project,
test/functional/activities_controller_test.rb
assert_response 404
end
def test_user_index_with_non_visible_user_id_should_respond_404
def test_user_index_with_non_visible_user_id_should_respond_without_processing_user_id_param
Role.anonymous.update! :users_visibility => 'members_of_visible_projects'
user = User.generate!
......
get :index, :params => {
:user_id => user.id
}
assert_response 404
assert_response :success
assert_select 'h2', :text => "Activity", :count => 1
assert_select "h2 a:match('href', ?)", /\/users\//, {:text => "Bob Doe", :count => 0}, "Not visible user link element and/or link text present"
end
def test_index_atom_feed
(2-2/3)