[ZBX-4562] API "mediatype.update" return wrong formatted result Created: 2012 Jan 19  Updated: 2017 May 30  Resolved: 2012 Mar 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 1.8.10
Fix Version/s: 1.8.11, 2.0.0rc1

Type: Incident report Priority: Minor
Reporter: Tomohiro Ikeda Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS5.5, MySQL



 Description   

I send to API
{
"method" : "mediatype.update"
"params" : [

{ "smtp_server" : "[email protected]", "mediatypeid" : 4 }

],
"auth" : "xxx",
"jsonrpc" : "2.0",
"id" : 1,
}

I expect
{"jsonrpc":"2.0","result":

{"mediatypeids":[4]}

,"id":1}
but get
{"jsonrpc":"2.0","result":

{"mediatypeids":true}

,"id":1}

So I modified frontends/php/api/classes/class.cmediatype.php

410d409
< $mediatypeids = zbx_objectValues($mediatypes, 'mediatypeid');
453c452
< DB::update('media_type', $update);

> $mediatypeids = DB::update('media_type', $update);



 Comments   
Comment by Toms (Inactive) [ 2012 Feb 29 ]

Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-4562

Comment by Alexey Fukalov [ 2012 Mar 01 ]

Trunk version tested, but this also should be fixed in 1.8 branch.

<Toms > RESOLVED Fixed in dev. branch: svn://svn.zabbix.com/branches/dev/ZBX-4562-18

<Vedmak> CLOSED

Comment by Toms (Inactive) [ 2012 Mar 06 ]

Fixed in 1.9 r.25749 and 1.8 r.25819

Comment by Pavels Jelisejevs (Inactive) [ 2012 Mar 08 ]

You forgot to add an entry in the trunk ChangeLog under the 1.8 section.

REOPENED.

<Toms> RESOLVED in r.25819

<richlv> revision 25819 modifies branches/1.8/ChangeLog
additionally, in the trunk changelog entry has been added for 1.9.10, not in the corresponding 1.8 section

<Toms> RESOLVED in r.25957

<richlv> the entry ordering did not match the one in the 1.8 changelog - i reordered them in rev 25958, please review

<pavels> I think the first letter should be in lower case. Otherwise, everything is fine. CLOSED.

Generated at Thu Apr 25 16:44:22 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.