Should redirect to final page when out_of_range in projects/builds#index

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

Should redirect to final page when out_of_range in projects/builds#index

Steps to reproduce

See below screenshots

What is the current bug behavior?

Jump to empty page

What is the expected correct behavior?

Jump to last page

Relevant logs and/or screenshots

projects/builds#index (Lack of implementation)

Mar-28-2017_21-14-18

projects/issues#index (Proper)

Mar-28-2017_21-14-22

Possible fixes

# app/controllers/projects/issues_controller.rb
if @issues.out_of_range? && @issues.total_pages != 0
  return redirect_to url_for(params.merge(page: @issues.total_pages))
end

/cc @grzesiek

Suggestion tag ~"Accepting Merge Requests"

Edited Sep 04, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading