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

Undefined index in Action API update method

XMLWordPrintable

      1. Create action.
      2. Perform action.update in API similar to this:
        API::Action()->update([
            [
                'actionid' => '51',
                'operations' => [
                    [
                        'operationid' => 212,
                        'operationtype' => 0,
                        'esc_period' => '0s',
                        'esc_step_from' => 1,
                        'esc_step_to' => 2,
                        'evaltype' => 0,
                        'opmessage_grp' => [
                            [
                                'usrgrpid' => '7'
                            ]
                        ]
                    ]
                ]
            ]
        ]);
        

        Which means excluding "actionid" from "operations" object.

      This results in errors:
      Undefined index: actionid [... -> CApiWrapper->__call() -> CFrontendApiWrapper->callMethod() -> CApiWrapper->callMethod() -> CFrontendApiWrapper->callClientMethod() -> CLocalApiClient->callMethod() -> CAction->update() -> CAction->updateOperations() -> CConfigFile->{closure}() in include\classes\api\services\CAction.php:1219]
      Undefined index: [... z-> CApiWrapper->__call() z-> CFrontendApiWrapper->callMethod() z-> CApiWrapper->callMethod() z-> CFrontendApiWrapper->callClientMethod() z-> CLocalApiClient->callMethod() z-> CAction->update() z-> CAction->updateOperations() z-> CConfigFile->{closure}() in include\classes\api\services\CAction.php:1219]

      Maybe it's time to remove "actionid" from "operations" object since it already exists in "action" object.

            zabbix.dev Zabbix Development Team
            iivs Ivo Kurzemnieks
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: