diff --git a/ole-app/olefs/src/main/java/org/kuali/ole/describe/controller/WorkEInstanceOlemlEditor.java b/ole-app/olefs/src/main/java/org/kuali/ole/describe/controller/WorkEInstanceOlemlEditor.java index ec5871bb2e..25d5b73024 100644 --- a/ole-app/olefs/src/main/java/org/kuali/ole/describe/controller/WorkEInstanceOlemlEditor.java +++ b/ole-app/olefs/src/main/java/org/kuali/ole/describe/controller/WorkEInstanceOlemlEditor.java @@ -21,6 +21,7 @@ import org.kuali.ole.docstore.model.enums.DocType; import org.kuali.ole.describe.bo.InstanceEditorFormDataHandler; import org.kuali.ole.describe.form.InstanceEditorForm; +import org.kuali.ole.select.bo.OLEDonor; import org.kuali.ole.select.bo.OLEEditorResponse; import org.kuali.ole.select.businessobject.*; import org.kuali.ole.select.document.OLEEResourceInstance; @@ -377,14 +378,31 @@ public EditorForm saveDocument(EditorForm editorForm) { List donorInfos = eHoldings.getDonorInfo(); if(donorInfos.size() > 0) { for (DonorInfo donorInformation : donorInfos) { - if (null != donorInformation.getDonorNote()) { + + if(donorInformation.getDonorPublicDisplay() != null || donorInformation.getDonorNote() != null) { + String modifiedDonorNoteValue = donorInformation.getDonorNote().replaceAll("\"","""); + String modifiedDonorDisplayValue = donorInformation.getDonorPublicDisplay().replaceAll("\"","""); + donorInformation.setDonorNote(modifiedDonorNoteValue); + donorInformation.setDonorPublicDisplay(modifiedDonorDisplayValue); + } + else { + Map donorMap = new HashMap(); + donorMap.put("donorCode", donorInformation.getDonorCode()); + OLEDonor oleDonor = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEDonor.class, donorMap); + String modifiedDonorNoteValue = oleDonor.getDonorNote().replaceAll("\"","""); + String modifiedDonorDisplayValue = oleDonor.getDonorPublicDisplay().replaceAll("\"","""); + donorInformation.setDonorNote(modifiedDonorNoteValue); + donorInformation.setDonorPublicDisplay(modifiedDonorDisplayValue); + } + + /*if (null != donorInformation.getDonorNote()) { String modifiedValue = donorInformation.getDonorNote().replaceAll("\"","""); donorInformation.setDonorNote(modifiedValue); } if (null != donorInformation.getDonorPublicDisplay()) { String modifiedValue = donorInformation.getDonorPublicDisplay().replaceAll("\"","""); donorInformation.setDonorPublicDisplay(modifiedValue); - } + }*/ } eHoldings.setDonorInfo(donorInfos); }