.......... [ZBX-8816] fixed undefined index when editing an item prototype, minor code refactoring