Topitems HostOrdering by ItemValue Pattern Throws Internal Server Error

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 7.4.5
    • Component/s: Frontend (F)
    • None
    • Environment:
      Rocky 9, mariadb

      Steps to reproduce:

      1. Add a topitems widget
      2. In either the Host groups or Hosts configuration form field, set it to reference another widget
      3. Add an item pattern
      4. In the Advanced configuration of the main widget form, in the Host ordering section, change the toggle to 'Item Value' and start entering a pattern in the pattern box. You will see a console error 500.

      See screenshot:

       

      Here is the output of the web error logs when this happens:{}

      [10-Jan-2026 03:55:43 UTC] PHP Warning:  foreach() argument must be of type array|object, false given in /usr/share/zabbix/ui/include/hostgroups.inc.php on line 57
      [10-Jan-2026 03:55:43 UTC] PHP Fatal error:  Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, false given in /usr/share/zabbix/ui/include/hostgroups.inc.php:71
      Stack trace:
      #0 /usr/share/zabbix/ui/include/hostgroups.inc.php(71): array_keys()
      #1 /usr/share/zabbix/ui/jsrpc.php(797): getSubGroups()
      #2 {main}
        thrown in /usr/share/zabbix/ui/include/hostgroups.inc.php on line 71 

            Assignee:
            Zabbix Support Team
            Reporter:
            Ryan Eberly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: