This issue seems reasonably hard to reproduce because updating a
category seems to give a 500 error when updating it (after having added
it to a categoryCombo?).

                <b>root cause</b>
                <pre>java.lang.NullPointerException
        
org.hisp.dhis.dataelement.DataElementCategory.removeAllCategoryCombos(DataElementCategory.java:138)
        
org.hisp.dhis.dataelement.DataElementCategory.mergeWith(DataElementCategory.java:272)
        
org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.updateObject(DefaultIdentifiableObjectImporter.java:457)
        
org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.startImport(DefaultIdentifiableObjectImporter.java:551)
        
org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObjectLocal(DefaultIdentifiableObjectImporter.java:530)
        
org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporter.java:209)
        
org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter.importObject(DefaultIdentifiableObjectImporter.java:104)
        
org.hisp.dhis.dxf2.metadata.DefaultImportService.doImport(DefaultImportService.java:277)
        
org.hisp.dhis.dxf2.metadata.DefaultImportService.importObject(DefaultImportService.java:110)

The times when i did see it happen i presume it might have to do with
the following:

CategoryCombos are not marked as an `owned` property of a category
therefore these are not send back when doing the update. (See
https://play.dhis2.org/demo/api/schemas/category.json?fields=properties[fieldName,owner])

However in the merge it seems to remove all category combos? 
http://bazaar.launchpad.net/~dhis2-devs-core/dhis2/trunk/view/head:/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java#L272

I didn't dig into the code far enough to see if that is what it actually
does. But the app at least is sending the correct payload.

** Changed in: dhis2
     Assignee: Mark Polak (markpo) => Lars Helge Øverland (larshelge)

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

Title:
  Altering a Category in 2.22 21784 removes it from the assigned
  category combo

Status in DHIS:
  New

Bug description:
  Altering a Category in 2.22 21784 removes it from the assigned
  category combo

  Steps to reproduce
  1. Create a Category
  2. Assign Category to CatCombo
  3. Remove or add an option from the category from step 1
  4. Notice it is no longer a part of the CatCombo Assigned in step 2

  I imagine this might remove it from all the category combos (plural)
  but I haven't tested that far yet

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1540854/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

Reply via email to