Last Comment Bug 916979 - Bug.search ignores the "limit" parameter
: Bug.search ignores the "limit" parameter
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: WebService (show other bugs)
: 4.5
: x86 Mac OS X
: -- normal (vote)
: Bugzilla 5.0
Assigned To: David Lawrence [:dkl]
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-16 13:39 PDT by Tiziana Sellitto [:tiziana]
Modified: 2013-09-18 08:09 PDT (History)
4 users (show)
glob: approval+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
916979_1.patch (1.87 KB, patch)
2013-09-17 10:28 PDT, David Lawrence [:dkl]
glob: review+
Details | Diff | Splinter Review

Description Tiziana Sellitto [:tiziana] 2013-09-16 13:39:10 PDT
I'm using json-rpc interface to access Bugzilla API. It seems that from yesterday the "limit" and "creation_time" parameters don't work;

https://bugzilla.mozilla.org/jsonrpc.cgi?method=Bug.search&params=[{"limit":3,"product":"Firefox","component":"Untriaged","status":"UNCONFIRMED","include_fields":["creation_time","id","status","summary","last_change_time" ]}]

and the "creation_time" doesn't return anything:

https://bugzilla.mozilla.org/jsonrpc.cgi?method=Bug.search&params=[{"limit":3,"creation_time":"2011-07-09T17:56:00Z","product":"Firefox","component":"Untriaged","status":"UNCONFIRMED","include_fields":["creation_time","id","status","summary","last_change_time" ]}]


These searches worked fine up to two days ago. 
I've looked at this bug 785565 asking if it could be related.
Comment 1 Byron Jones ‹:glob› 2013-09-16 20:57:32 PDT
nothing was changed on production two days ago (the last update was Sep 11 00:15:35 PDT).

as there are two issues reported here, i've split the bug - the creation_time issue is in bug 917157.


the problem with limit is Bugzilla::Bug::map_fields() is converting $params->{limit} to $params->{LIMIT}, however Bugzilla::Search is expecting lowercase {limit} (this also applies to offset).
Comment 2 David Lawrence [:dkl] 2013-09-17 10:28:14 PDT
Created attachment 806099 [details] [diff] [review]
916979_1.patch

Simple remove LIMIT/OFFSET from FIELD_MAP in Bugzilla::Bug. Also cleaned up my variable naming in Bug.search as it was backwards.

dkl
Comment 3 Byron Jones ‹:glob› 2013-09-17 23:38:42 PDT
Comment on attachment 806099 [details] [diff] [review]
916979_1.patch

r=glob
Comment 4 David Lawrence [:dkl] 2013-09-18 08:09:30 PDT
Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/trunk
modified Bugzilla/Bug.pm
modified Bugzilla/WebService/Bug.pm
Committed revision 8741.

Note You need to log in before you can comment on or make changes to this bug.