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

Not possible to unlink template with items

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 7.0.0alpha4, 7.0 (plan)
    • 7.0.0alpha4
    • API (A)
    • None
    • Sprint 103 (Aug 2023)
    • 1

      Steps to reproduce:

      1. Create 2 templates;
      2. Add an item to one of templates - zabbix trapper, for example;
      3. Edit the template with no items and link the template with items to it (add in templates multiselect);
      4. Update the template;
      5. Edit the same template again and unlink the linked template.

      Result:
      No error or success messages displayed and template is not unlinked (see attached video).
      Configuration of templates - Google Chrome 2023-08-07 09-59-54.mp4

      Also multiple errors are logged in the error log:

      Undefined index: type in ~/work/branches/master/ui/include/classes/api/services/CItemGeneral.php on line 1309, referer: http://192.168.27.4/master/ui/templates.php
      
      Undefined index: type in ~/work/branches/master/ui/include/classes/api/services/CItemGeneral.php on line 1310, referer: http://192.168.27.4/master/ui/templates.php
      
       Uncaught TypeError: Argument 1 passed to CItemTypeFactory::getObject() must be of the type int, null given, called in ~/work/branches/master/ui/include/classes/api/services/CItemGeneral.php on line 1310 and defined in ~/work/branches/master/ui/include/classes/api/CItemTypeFactory.php:37\nStack trace:\n#0 ~/work/branches/master/ui/include/classes/api/services/CItemGeneral.php(1310): CItemTypeFactory::getObject()\n#1 ~/work/branches/master/ui/include/classes/api/services/CItem.php(817): CItemGeneral::addFieldDefaultsByType()\n#2 ~/work/branches/master/ui/include/classes/api/services/CItem.php(1363): CItem::updateForce()\n#3 ~/work/branches/master/ui/include/classes/api/services/CHostGeneral.php(596): CItem::unlinkTemplateObjects()\n#4 ~/work/branches/master/ui/include/classes/api/services/CHostGeneral.php(392): CHostGeneral::unlinkTemplatesObjects()\n#5 ~/work/branches/master/ui/include/classes/api/services/CTemplate.php(49 in ~/work/branches/master/ui/include/classes/api/CItemTypeFactory.php on line 37, referer: http://192.168.27.4/master/ui/templates.php 
      
      Undefined index: file in ~/work/branches/master/ui/include/classes/debug/CProfiler.php on line 381, referer: http://192.168.27.4/master/ui/templates.php
      
      Undefined index: line in ~/work/branches/master/ui/include/classes/debug/CProfiler.php on line 381, referer: http://192.168.27.4/master/ui/templates.php 
      
      Cannot modify header information - headers already sent in ~/work/branches/master/ui/include/classes/helpers/CCookieHelper.php on line 59, referer: http://192.168.27.4/master/ui/templates.php 
      
      Unknown: Failed to write session data using user defined save handler. (session.save_path: /var/lib/php/sessions) in Unknown on line 0, referer: http://192.168.27.4/master/ui/templates.php 

      Expected:
      Template unlinked with no errors.

       

      Note: This affects only master branch.

            vmaksimovs Vladimirs Maksimovs
            esekace Eliza Sekace
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: