Project

General

Profile

Bug #12493

scoped search error w/ API param page=0

Added by Thomas McKay almost 4 years ago. Updated about 1 year ago.

Status:
Need more information
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Passing page=0 as param causes error in scoped search.

2015-11-16T09:18:27 [app] [E] RangeError: invalid page: 0
 | /home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/will_paginate-3.0.7/lib/will_paginate/page_number.rb:18:in `initialize'
 | /home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/will_paginate-3.0.7/lib/will_paginate/page_number.rb:54:in `new'
 | /home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/will_paginate-3.0.7/lib/will_paginate/page_number.rb:54:in `PageNumber'
 | /home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/will_paginate-3.0.7/lib/will_paginate/active_record.rb:186:in `page'
 | /home/vagrant/.rvm/gems/ruby-1.9.3-p448/gems/will_paginate-3.0.7/lib/will_paginate/active_record.rb:167:in `paginate'
 | /home/vagrant/code/katello/app/controllers/katello/api/v2/api_controller.rb:101:in `scoped_search'
 | /home/vagrant/code/katello/app/controllers/katello/api/v2/systems_controller.rb:61:in `index'

History

#1 Updated by Thomas McKay almost 4 years ago

Unsure if we should fix or not. Passing in zero worked with elasticsearch so could be considered a regression in behavior since going to scoped. On the other hand, passing zero (or any other "bad" page number) should be discouraged.

#2 Updated by Eric Helms over 3 years ago

  • Category deleted (API)
  • Legacy Backlogs Release (now unused) set to 86
  • Triaged changed from No to Yes

Seems like this is the type of exception that should be caught and sent to the user with a proper return ocde and user friendly message?

#3 Updated by Eric Helms over 3 years ago

  • Status changed from New to Need more information
  • Legacy Backlogs Release (now unused) changed from 86 to 143

#4 Updated by Justin Sherrill about 3 years ago

  • Legacy Backlogs Release (now unused) changed from 143 to 114

Also available in: Atom PDF