=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.java 2016-02-29 07:35:27 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/hooks/IdentifiableObjectBundleHook.java 2016-02-29 07:46:20 +0000 @@ -60,7 +60,7 @@ for ( AttributeValue attributeValue : identifiableObject.getAttributeValues() ) { Attribute attribute = bundle.getPreheat().get( bundle.getPreheatIdentifier(), attributeValue.getAttribute() ); - if ( attribute != null ) attributeValue.setAttribute( attribute ); + attributeValue.setAttribute( attribute ); sessionFactory.getCurrentSession().save( attributeValue ); } } @@ -68,12 +68,11 @@ public void handleUserGroupAccessesCreate( IdentifiableObject identifiableObject, ObjectBundle bundle, Schema schema ) { if ( !schema.havePersistedProperty( "userGroupAccesses" ) ) return; - identifiableObject.getUserGroupAccesses().clear(); for ( UserGroupAccess userGroupAccess : identifiableObject.getUserGroupAccesses() ) { UserGroup userGroup = bundle.getPreheat().get( bundle.getPreheatIdentifier(), userGroupAccess.getUserGroup() ); - if ( userGroup != null ) userGroupAccess.setUserGroup( userGroup ); + userGroupAccess.setUserGroup( userGroup ); sessionFactory.getCurrentSession().save( userGroupAccess ); } }