Sorry. Script kiddies like me should probably not dabble in all this
code, but sometimes you gotta get things to work.
So, at this point (rev 1938) something happened.
getOrganisationUnitByShortName method was switched to
getOrganisationUnitByCode in the OrganisationUnitImporter. I keep
getting weird problems that I used to not have trying to import either
from DHIS 1.4 XML or DHIS1.4 files with earlier versions of DHIS2. By
NULLING the "code" field entirely in the orgunit table of the 1.4
database, I can import from DHIS 1.4 database which has duplicates in
the code field prior to NULLING all the fields.
Was there are reason that this method was switched ? According to this
code, isn't the matching during an import occurring first by name and
then by code? Since there is not a unique restriction on the code,
what if multiple orgunits are returned?
I suspect this is related to the same problem I had reported a few
days ago about not being able to import stuff via DXF.
Can someone that knows what they are doing take a look at it?
his\importexport\importer>bzr diff OrganisationUnitImporter.java -r 1937
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/
mportexport/importer/OrganisationUnitImporter.java 2010-07-30 14:20:36 +000
mportexport/importer/OrganisationUnitImporter.java 2011-01-28 12:21:19 +000
@@ -104,7 +104,7 @@
if ( match == null )
- match = organisationUnitService.getOrganisationUnitByShortName( obj
+ match = organisationUnitService.getOrganisationUnitByCode( object.g
Jason P. Pickering