← Back to team overview

dhis2-devs team mailing list archive

Two shortName errors

 

Greetings. Hopefully this is the right location for this issue. I have
discovered a few issues seemingly revolving around the shortName field. On
the Maintenance app the field is often shown as not required. This is
apparently not entirely the case.


*1: 500 Error on creating DE Group with empty ShortName*
Route: /dhis-web-maintenance/#/edit/dataElementSection/dataElementGroup/add

How to replicate:

Add new Data Element Group
Specify a unique Name
Put a space (possibly anything) into the shortname field, but then remove it
Save

Add a second new DE Group
Specify a unique Name
Put a space into the shortname, then remove it
Put something into the code field (so the form thinks we are entering data)
Save


Check network console for error 500 response. Digging through you will see:
  org.postgresql.util.PSQLException: ERROR: duplicate key value violates
unique constraint "uk_6x37lph70r5mh15a71pf1tj17"
    Detail: Key (shortname)=() already exists.

Expectation:
Either allow for empty shortnames, or prevent submission.

*2: Organisational Unit shortName Bypass*
How to replicate:

Add a new OU
Enter Opening Date
Enter Name
Put a space into the shortname, then remove it
Save

Repeat

The first record is created without a shortname. The network response is
"200 OK" but the contents of the response contains
  "importConflicts":[
    {"object":"aaaaa","value":"Empty shortName for object ...

Repeat the process and more records will be created. This time they will
have an additional "conflict":
"importConflicts":[
  {"object":"eeeee","value":"Empty shortName for object ...
  {"object":"eeeee","value":"Object already exists."}

"eeeee" does not already exist as this is the first time I used that Name.
I think it is trying to key off of shortName (blank).

Expectation:
Either allow for empty shortnames, or prevent submission.


Hope this helps.

-- 
Greg Wilson
BAO Systems

Follow ups