Steps to reproduce:
1. Create host.
2. Create 4 items on host: 1st item is master item, 2nd item depends on 1st, 3rd item depends on 2nd, 4th item depends on 3rd.
3. Create Discovery rule with 1 item prototype. Type - trapper. Save prototype.
4. Open Item Prototype configuration and change type to Dependent item. Choose 4th item as master item.
Get expected error: Incorrect value for field "master_itemid": maximum number of dependency levels reached.
Get undefined index error below the page (NOT expected):