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

No history links in trigger popups for triggers with 2 or more items

XMLWordPrintable

      If we create a trigger with at least two items in expression, the popup window will not show links to history of the items. (1.png).

      I've tracked down the issue to tr_status.php, line 547, but the problem probably lies somewhere in setMenuPopup or getTrigger.
      $description->setMenuPopup(CMenuPopupHelper::getTrigger($trigger, $triggerItems));

      Checking the value of the array returned by getTrigger:

      $descArray = CMenuPopupHelper::getTrigger($trigger, $triggerItems);
      print_r($descArray);

      Array ( 
      [type] => trigger 
      [triggerid] => 15217 
      [items] => Array ( 
        [1] => Array ( 
          [name] => Procent wolnego miejsca na C: 
          [params] => Array ( 
            [itemid] => 30666 
            [action] => showgraph 
          ) 
        ) 
        [0] => Array ( 
          [name] => Wolne miejsce na C: 
          [params] => Array ( 
            [itemid] => 30665 
            [action] => showgraph 
          ) 
        ) 
      ) 
      [acknowledge] => [eventTime] => [configuration] => Array ( 
          [hostid] => 10276 
      ) [url] => [showEvents] => 1 )
      

      The index of the nested array "index" starts at 1 - something futher down doesn't cope well with this.
      A simple fix which fixed the issue:

      $description = new CSpan($trigger['description'], 'link_menu');
      $triggerPopupData = CMenuPopupHelper::getTrigger($trigger, $triggerItems);
      sort($triggerPopupData['items']);
      $description->setMenuPopup($triggerPopupData);
      

        1. trigger_hosts_before.png
          trigger_hosts_before.png
          6 kB
        2. trigger_hosts_after.png
          trigger_hosts_after.png
          7 kB
        3. 2.png
          2.png
          12 kB
        4. 1.png
          1.png
          17 kB

            Unassigned Unassigned
            jkuc Jakub Kuchta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: