← Back to team overview

dhis2-devs team mailing list archive

[Bug 510109] Re: Catcombo deletion problems

 

Number 1 and 2 are solved.

-- 
Catcombo deletion problems
https://bugs.launchpad.net/bugs/510109
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.

Status in DHIS 2 - District Health Information Software: Confirmed

Bug description:
When deleting categorycombos I've come across a few issues:

1) When trying to delete a categorycombo that has categoryoptioncombos referenced in datavalue an exception is thrown. This should be replaced by a more appropriate message saying something like "You cannot delete this object as it is referenced by data values". When doing the same for categories you get a nice little pop up saying something like that, which is needed for catcombos as well.

2) When trying to delete catcombos "with" data like above the catcombo is not deleted (which is good), but before you get the exception the reference from all data elements to that catcombo is deleted and replaced by the default. This is very confusing and not correct behaviour. Would it be possible to to a dry run like process and check whether the catcombo can actually be deleted before deleting the data element-catcombo associations?

3) When deleting a catcombo that "has" no data then the catcombo is deleted together with its categoryoptioncombos. But indicator formulas referencing those deleted catoptioncombos are not deleted, so when opening such a formula you get an exception like this:
Exception (java.lang.IllegalArgumentException): Identifier does not reference a category option combo: 360802 
Same thing probably goes for validation rules, but haven't checked this yet. I suggest we simply empty the formulas that contain deleted catoptioncombos and leave it up to the user to fill in a new valid formula. No need to delete the indicator itself. The ideal would be to provide the user with a list of indicators and validation rules where formulas have been deleted to make the user aware of the need to updated these.





Follow ups

References