From 487121b74e65c8f85a84868321b5d596f2476777 Mon Sep 17 00:00:00 2001 From: Patrick Schmitz Date: Wed, 17 Aug 2011 23:56:22 +0000 Subject: [PATCH] NOJIRA - Added safety check in filterReadOnlyPropertiesForPart to ensure it only checks for values in the common part. Quite an edge case, but would be a very confusing bug if someone created an extension part that had fields with the same names and tried to update them. --- .../nuxeo/AuthorityItemDocumentModelHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index 0420d9242..eed07a053 100644 --- a/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -191,8 +191,11 @@ public abstract class AuthorityItemDocumentModelHandler public void filterReadOnlyPropertiesForPart( Map objectProps, ObjectPartType partMeta) { super.filterReadOnlyPropertiesForPart(objectProps, partMeta); - objectProps.remove(AuthorityItemJAXBSchema.IN_AUTHORITY); - objectProps.remove(AuthorityItemJAXBSchema.CSID); + String commonPartLabel = getServiceContext().getCommonPartLabel(); + if(partMeta.getLabel().equalsIgnoreCase(commonPartLabel)) { + objectProps.remove(AuthorityItemJAXBSchema.IN_AUTHORITY); + objectProps.remove(AuthorityItemJAXBSchema.CSID); + } } @Override -- 2.47.3