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

[Popup forms] Runtime error appears when URL contains context parameter with incorrect reference

XMLWordPrintable

    • S25-W4/5, S25-W6/7, S25-W8/9, S25-W10/11
    • 1

      Steps to reproduce:

      Case 1

      • Open any template with items
      • Open edit form for item
      • Change url context value from template to host e.g.
      /zabbix.php?action=popup&popup=item.edit&context=host&itemid=46050
      

      Case 2

      • Create host with item
      • Open edit form for the item
      • Change url context value from host to template e.g.
      /zabbix.php?action=popup&popup=item.edit&context=template&itemid={your_itemid}
      

      Result:  Runtime error appears => 
      For incorrect context in host items:

      Undefined array key 0 [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerItemEdit->doAction() -> CControllerItemEdit->getTemplate() -> CConfigFile->{closure}() in app/controllers/CControllerItemEdit.php:169]
      Trying to access array offset on null [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerItemEdit->doAction() -> CControllerItemEdit->getTemplate() -> CConfigFile->{closure}() in app/controllers/CControllerItemEdit.php:174]
      TypeError: Unsupported operand types: null + array in /home/zabbix/workspace/7.2/ui/app/controllers/CControllerItemEdit.php:174
      Stack trace:
      #0 /home/zabbix/workspace/7.2/ui/app/controllers/CControllerItemEdit.php(65): CControllerItemEdit->getTemplate()
      #1 /home/zabbix/workspace/7.2/ui/include/classes/mvc/CController.php(471): CControllerItemEdit->doAction()
      #2 /home/zabbix/workspace/7.2/ui/include/classes/core/ZBase.php(643): CController->run()
      #3 /home/zabbix/workspace/7.2/ui/include/classes/core/ZBase.php(228): ZBase->processRequest()
      #4 /home/zabbix/workspace/7.2/ui/include/config.inc.php(20): ZBase->run()
      #5 /home/zabbix/workspace/7.2/ui/zabbix.php(17): require_once('...')
      #6 {main}
      

      For incorrect context in template items:

      Undefined array key 0 [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerItemEdit->doAction() -> CControllerItemEdit->getHost() -> CConfigFile->{closure}() in app/controllers/CControllerItemEdit.php:141]
      Trying to access array offset on null [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerItemEdit->doAction() -> CControllerItemEdit->getHost() -> CConfigFile->{closure}() in app/controllers/CControllerItemEdit.php:147]
      Trying to access array offset on null [zabbix.php:17 -> require_once() -> ZBase->run() -> ZBase->processRequest() -> CController->run() -> CControllerItemEdit->doAction() -> CControllerItemEdit->getHost() -> CConfigFile->{closure}() in app/controllers/CControllerItemEdit.php:152]
      TypeError: array_column(): Argument #1 ($array) must be of type array, null given in /home/zabbix/workspace/7.2/ui/app/controllers/CControllerItemEdit.php:152
      Stack trace:
      #0 /home/zabbix/workspace/7.2/ui/app/controllers/CControllerItemEdit.php(152): array_column()
      #1 /home/zabbix/workspace/7.2/ui/app/controllers/CControllerItemEdit.php(65): CControllerItemEdit->getHost()
      #2 /home/zabbix/workspace/7.2/ui/include/classes/mvc/CController.php(471): CControllerItemEdit->doAction()
      #3 /home/zabbix/workspace/7.2/ui/include/classes/core/ZBase.php(643): CController->run()
      #4 /home/zabbix/workspace/7.2/ui/include/classes/core/ZBase.php(228): ZBase->processRequest()
      #5 /home/zabbix/workspace/7.2/ui/include/config.inc.php(20): ZBase->run()
      #6 /home/zabbix/workspace/7.2/ui/zabbix.php(17): require_once('...')
      

      Expected: Proper error handling. I suppose there should be fatal error something like this =>

        1. image-2025-01-24-13-37-33-925.png
          image-2025-01-24-13-37-33-925.png
          8 kB
        2. image-2025-03-07-11-06-02-600.png
          image-2025-03-07-11-06-02-600.png
          139 kB
        3. image-2025-03-07-11-06-51-051.png
          image-2025-03-07-11-06-51-051.png
          118 kB
        4. image-2025-03-07-11-27-51-931.png
          image-2025-03-07-11-27-51-931.png
          20 kB
        5. image-2025-03-07-11-39-50-825.png
          image-2025-03-07-11-39-50-825.png
          83 kB
        6. image-2025-03-07-11-50-40-152.png
          image-2025-03-07-11-50-40-152.png
          86 kB
        7. screenshot-1.png
          screenshot-1.png
          42 kB
        8. screenshot-2.png
          screenshot-2.png
          70 kB
        9. screenshot-3.png
          screenshot-3.png
          126 kB

            mtalbergs Martins Talbergs
            kseve Kirils Seve
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 8h Original Estimate - 8h
                8h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 13.75h
                13.75h