Possibly unused code in Item API update validateInventoryLinks() function

XMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 2.1.6
    • Component/s: API (A)

      In Item API there is a function validateInventoryLinks() which receives an array with items. First of all it cycles through items and checks for inventory_link parameter. If no inventory_link parameter, it unsets the item, so it doesn't continue validation. In update method there is additional validation for checking inventory_link. The code piece highlighted in attached image will never execute. The variable $itemsWithNoInventoryLink will always be empty and the rest $itemsWithNoHostId, $itemsWithNoKeys are also empty because hostid and key_ are already taken from DB before this function.

      The function validateInventoryLinks() requires investigation.

            Assignee:
            Unassigned
            Reporter:
            Ivo Kurzemnieks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: