Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4562

API "mediatype.update" return wrong formatted result

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.10
    • Fix Version/s: 1.8.11, 2.0.0rc1
    • Component/s: API (A)
    • Labels:
      None
    • Environment:
      CentOS5.5, MySQL

      Description

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

      { "smtp_server" : "sample@sample.com", "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);

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikeda Tomohiro Ikeda
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: