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
    • 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 =>

            zabbix.dev Zabbix Development Team
            kseve Kirils Seve
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 8h
                8h
                Remaining:
                Time Spent - 7.75h Remaining Estimate - 0.25h
                0.25h
                Logged:
                Time Spent - 7.75h Remaining Estimate - 0.25h
                7.75h