Commit a41000c3 authored by André Hänsel's avatar André Hänsel

Fix missing RSS feed events

The ProjectsController currently loads a list of projects the user has
access to in the function load_projects. It uses this list to render the
actual list of projects, but it also uses this list to render the
activity feed in the atom form for the RSS feed.

The problem is that load_projects already paginates the list of projects
which leads to wrong results (only the first 20 projects are considered)
when rendering the RSS feed.

The error was intruduced in 837c3b3d, so this commit partially reverts
the changes made in that commit, moving the pagination back out of
load_projects and into the respective routes.
parent 00d4d5be
......@@ -33,7 +33,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def starred
@projects = load_projects(params.merge(starred: true))
.includes(:forked_from_project, :tags)
.includes(:forked_from_project, :tags).page(params[:page])
@groups = []
......@@ -51,7 +51,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
private
def projects
@projects ||= load_projects(params.merge(non_public: true))
@projects ||= load_projects(params.merge(non_public: true)).page(params[:page])
end
def render_projects
......@@ -73,7 +73,6 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
.execute
.includes(:route, :creator, :group, namespace: [:route, :owner])
.preload(:project_feature)
.page(finder_params[:page])
prepare_projects_for_rendering(projects)
end
......
---
title: Fix missing RSS feed events
merge_request: 19524
author:
type: fixed
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