You could have noted after upgrading DHIS2 from lower version to 2.24 or so, the organisationunits may not load when opening data entry module or user managerment so you can’t attach any user to any orgunit.
We noted that the issue is brought about by a Token Error on uid. All the orgunits with uid starting with a number will cause this to fail in dhis2 2.24 or so. To resolve, we managed to write an SQL query to update the uids as below.
UPDATE organisationunit SET uid = (
CASE
WHEN (substring(uid FROM 1 FOR 1)) = '0'
THEN 'o' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '1'
THEN 'a' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '2'
THEN 'b' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '3'
THEN 'c' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '4'
THEN 'd' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '5'
THEN 'e' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '6'
THEN 'f' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '7'
THEN 'g' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '8'
THEN 'h' || substring(uid FROM 2)
WHEN (substring(uid FROM 1 FOR 1)) = '9'
THEN 'i' || substring(uid FROM 2)
You could have noted after upgrading DHIS2 from lower version to 2.24 or so, the organisationunits may not load when opening data entry module or user managerment so you can’t attach any user to any orgunit.
We noted that the issue is brought about by a Token Error on uid. All the orgunits with uid starting with a number will cause this to fail in dhis2 2.24 or so. To resolve, we managed to write an SQL query to update the uids as below.
I managed to do that using the PSQL query above. Thought some people could be having the same problem and running that query can sort them out as fast as possible.
You could have noted after upgrading DHIS2 from lower version to 2.24 or so, the organisationunits may not load when opening data entry module or user managerment so you can’t attach any user to any orgunit.
We noted that the issue is brought about by a Token Error on uid. All the orgunits with uid starting with a number will cause this to fail in dhis2 2.24 or so. To resolve, we managed to write an SQL query to update the uids as below.