Inconsistency errors by using API
We have detected some inconsistency errors at Extras > CMDB > Export -> All objects by a selected location.
Doing the same stuff (create objects and assign their location) by GUI and by API when we export as XML we cant fetch API created object because we receive the error ''There were no childs found for your selection!" and it is not correct. For GUI created objects works perfect.
Also this becomes inconsistent if you then change relationships by hand at GUI between API and GUI created objects, as result we can got Root location as child of the API created object.
Steps to reproduce:
- Create a location object (A1) and assign it as children of Root location.
- Create a object (A2) and assign it as children of previous object.
- Do the same stuff by API, of course with different objects (B1 and B2).
- Check export using A1 (GUI created). Success with expected result.
- Check export using B1 (API created). Error ''There were no childs found for your selection!"
- Assign B2 as children of A1
- Check export using A1. Result contains objects: A1 (ok), A2 (ok), Root location (inconsistency error) and B2 (ok)
Finally we found how to solve the problem:
We run this fix before and after import to prevent fail situations.