diff --git a/grails-app/services/au/org/ala/ecodata/ProjectService.groovy b/grails-app/services/au/org/ala/ecodata/ProjectService.groovy index 41b8b09a0..8e6840a47 100644 --- a/grails-app/services/au/org/ala/ecodata/ProjectService.groovy +++ b/grails-app/services/au/org/ala/ecodata/ProjectService.groovy @@ -485,6 +485,11 @@ class ProjectService { props = includeProjectActivities(props, projectActivities) try { + // Custom currently holds keys "details" and "dataSets". Only update the "custom" properties + // that are supplied in the update, leaving the others intact. + if (project.custom && props.custom) { + project.custom.putAll(props.remove('custom')) + } bindEmbeddedProperties(project, props) commonService.updateProperties(project, props) if (shouldUpdateCollectory) { diff --git a/src/test/groovy/au/org/ala/ecodata/ProjectServiceSpec.groovy b/src/test/groovy/au/org/ala/ecodata/ProjectServiceSpec.groovy index 856ee7b16..a5b01f8e7 100644 --- a/src/test/groovy/au/org/ala/ecodata/ProjectServiceSpec.groovy +++ b/src/test/groovy/au/org/ala/ecodata/ProjectServiceSpec.groovy @@ -828,4 +828,26 @@ class ProjectServiceSpec extends MongoSpec implements ServiceUnitTest