← Back to team overview

dhis2-devs team mailing list archive

Re: Metadata importer: buggy behavior when importing unordered orgunits

 

HI

Yeah, I see there is something strange going on, will look into it.

-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org

On Thu, Sep 1, 2016 at 1:30 PM, Victor Garcia <vgarciabnz@xxxxxxxxx> wrote:

> Version 2.24r23585.
> New importer endpoint: /api/24/metadata
>
> On 1 September 2016 at 03:01, Morten Olav Hansen <morten@xxxxxxxxx> wrote:
>
>> What version if DHIS and which endpoint are you using?
>>
>>
>> On Wednesday, 31 August 2016, Victor Garcia <vgarciabnz@xxxxxxxxx> wrote:
>>
>>> Hi all,
>>>
>>> we have found a strange behavior in the new metadata importer.
>>>
>>> Let's create two related orgunits, "Project" (parent) and "Health Site"
>>> (child), and export them using the new exporter which defaults to order by
>>> 'name'. The payload will contain "Project" first and "Health Site" later.
>>>
>>> Then, if we import the file in another instance using the new importer,
>>> it gives us the following:
>>> 1. Project orgunit is correctly imported.
>>> 2. Health Site orgunit is imported, but the "parent" field is left
>>> empty, and also the path is wrong. In fact, it is created as another *root
>>> orgunit!*
>>>
>>> I don't know if the new importer expects ordered elements, but this
>>> behavior is quite dangerous... We test the same file with old importer, and
>>> it works fine.
>>>
>>> You can find attached a payload that can be used with demo server (it
>>> hangs from Sierra Leone orgunit).
>>>
>>> Regards,
>>>
>>> Víctor
>>>
>>
>>
>> --
>> --
>> Morten Olav Hansen
>> Senior Engineer, DHIS 2
>> University of Oslo
>> http://www.dhis2.org
>>
>>
>

Follow ups

References