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

Incorrect generation of the order of preprocessing steps

XMLWordPrintable

    • Sprint 54 (Jul 2019)
    • 1

      Problem 1:
      /include/classes/api/services/CItemGeneral.php:

      protected function createItemPreprocessing(array $items) {
                      $item_preproc = [];
                      $step = 1;
       
                      foreach ($items as $item) {
                              if (array_key_exists('preprocessing', $item)) {
                                      foreach ($item['preprocessing'] as $preprocessing) {
                                              $item_preproc[] = [
                                                      'itemid' => $item['itemid'],
                                                      'step' => $step++,
                                                      'type' => $preprocessing['type'],
                                                      'params' => $preprocessing['params']
                                              ];
                                      }
                              }
                      }
      

      Variable definition $step=1 is outside of the foreach cycle, 99999+ step can be generated.

      Problem 2:
      The same step generation:

      Result:
      Steps are performed out of order.

      Expected:
      Steps are performed in step by step order.

        1. proc3.jpg
          34 kB
          Edgar Akhmetshin
        2. sql2.jpg
          63 kB
          Edgar Akhmetshin

            iivs Ivo Kurzemnieks
            edgar.akhmetshin Edgar Akhmetshin
            Team B
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: