Project

General

Profile

Actions

Bug #12493

open

scoped search error w/ API param page=0

Added by Thomas McKay over 8 years ago. Updated over 5 years ago.

Status:
Need more information
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
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'
Actions #1

Updated by Thomas McKay over 8 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.

Actions #2

Updated by Eric Helms over 8 years ago

  • Category deleted (API)
  • translation missing: en.field_release 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?

Actions #3

Updated by Eric Helms about 8 years ago

  • Status changed from New to Need more information
  • translation missing: en.field_release changed from 86 to 143
Actions #4

Updated by Justin Sherrill over 7 years ago

  • translation missing: en.field_release changed from 143 to 114
Actions

Also available in: Atom PDF