mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
only clone for add events
This commit is contained in:
@@ -250,10 +250,7 @@ export class SectionFormOperationsService {
|
|||||||
fieldValue = new FormFieldMetadataValueObject(value);
|
fieldValue = new FormFieldMetadataValueObject(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make a copy of fieldvalue for returning,
|
return fieldValue;
|
||||||
// so any changes to it can't influence the original.
|
|
||||||
// fixes #817
|
|
||||||
return deepClone(fieldValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -314,7 +311,7 @@ export class SectionFormOperationsService {
|
|||||||
event: DynamicFormControlEvent
|
event: DynamicFormControlEvent
|
||||||
): void {
|
): void {
|
||||||
const path = this.getFieldPathSegmentedFromChangeEvent(event);
|
const path = this.getFieldPathSegmentedFromChangeEvent(event);
|
||||||
const value = this.getFieldValueFromChangeEvent(event);
|
const value = deepClone(this.getFieldValueFromChangeEvent(event));
|
||||||
if (isNotEmpty(value)) {
|
if (isNotEmpty(value)) {
|
||||||
value.place = this.getArrayIndexFromEvent(event);
|
value.place = this.getArrayIndexFromEvent(event);
|
||||||
if (hasValue(event.group) && hasValue(event.group.value)) {
|
if (hasValue(event.group) && hasValue(event.group.value)) {
|
||||||
|
Reference in New Issue
Block a user